<?php
session_start();
header("Content-type: text/html; charset=utf-8"); //svn
require('../../config.php');
require('../../customer_id_decrypt.php'); //导入文件,获取customer_id_en[加密的customer_id]以及customer_id[已解密]
require('../../common/utility.php');
$link = mysql_connect(DB_HOST,DB_USER,DB_PWD);
mysql_select_db(DB_NAME) or die('Could not select database');
require('../../common/jssdk.php');
require('../../proxy_info.php');

//$template_id=-1;
$template_id=1; //自定义模板需要，将template_id初始化变成0
_mysql_query("SET NAMES UTF8");
define("InviteUrl","//".CLIENT_HOST."/weixinpl/common_shop/jiushop/forward.php?type=1&customer_id=");
$linkurl =InviteUrl.$customer_id_en;

/*  应该废弃掉了 改为 JSSDK（）

$query = 'SELECT id,appid,appsecret,access_token,isauth FROM weixin_menus where isvalid=true and customer_id='.$customer_id;
$result = _mysql_query($query) or die('Query failed19: ' . mysql_error());
$access_token   = "";
$appid          = "";
$appsecret      = "";
$isauth         =  0;
//echo var_dump($_SESSION);

while ($row = mysql_fetch_object($result)) {
	$keyid        =  $row->id ;
	$appid        =  $row->appid ;
	$appsecret    = $row->appsecret;
	$access_token = $row->access_token;

	$isauth       = $row->isauth; //微信公众号是否认证;1:认证.0:未认证
	break;

}
*/

/* echo $fromuser;return; */
$i = 0;
$jssdk = new JSSDK($customer_id);
$signPackage = $jssdk->GetSignPackage();


$apptype = 0;
if(!empty($_GET["apptype"])){			//判断是哪里进来的用户类型 0:微信 4:app用户
	$apptype = $configutil->splash_new($_GET["apptype"]);
	$_SESSION["apptype".$customer_id] = $apptype;
}


//头文件----start
require('../../common/common_from.php');
//头文件----end


/* echo 'user_id === '.$user_id.'<br/>';
echo 'customer_id === '.$customer_id.'<br/>';
echo 'is_bind === '.$is_bind.'<br/>'; */

//user_id解密
if(!is_numeric($user_id)){
	$user_id = (int)passport_decrypt($user_id);
}
$exp_user_id = $_REQUEST['exp_user_id'];
$sql = "SELECT shop_name,weixin_headimgurl,ps.status,wu.weixin_name from weixin_users wu
		left JOIN promoters ps ON ps.user_id = wu.id
		left JOIN weixin_commonshop_microshop ms ON ms.user_id = wu.id
		WHERE wu.isvalid = TRUE AND ps.isvalid = TRUE AND ps.status=1 and wu.customer_id = '{$customer_id}' and wu.id='{$exp_user_id}' ";
$result = _mysql_query($sql) or die(mysql_error().$sql);

if($result){
	$res = mysql_fetch_assoc($result);
}
$microsshop_name = $res['shop_name'];
$user_weixin_headimgurl = $res['weixin_headimgurl'];
$status = $res['status'];
$weixin_name = $res['weixin_name'];
$microsshop_name = $microsshop_name?$microsshop_name:$weixin_name;
// var_dump($user_weixin_headimgurl);
if(empty($user_weixin_headimgurl)){
	// $user_weixin_headimgurl = "http://".$_SERVER['SERVER_NAME']."/weixinpl/common/images_V6.0/contenticon/no-pic.jpg";
}else{
	if (strpos($user_weixin_headimgurl,"http")===0){

	}else{
		$pos1 = strpos($user_weixin_headimgurl,"../../../");
		$pos2 = strpos($user_weixin_headimgurl,"../../");
		$pos3 = strpos($user_weixin_headimgurl,"../");
		$pos4 = strpos($user_weixin_headimgurl,"/weixinpl");
		if($pos1===0){
			$user_weixin_headimgurl = substr($user_weixin_headimgurl,9);
		}elseif($pos2===0){
			$user_weixin_headimgurl = substr($user_weixin_headimgurl,6);
		}elseif($pos3===0){
			$user_weixin_headimgurl = substr($user_weixin_headimgurl,3);
		}
		if( $pos4 === 0 ){
			$user_weixin_headimgurl = $protocol_http_host.$user_weixin_headimgurl;
		} else {
			$user_weixin_headimgurl = BaseURL.$user_weixin_headimgurl;
		}

	}

}

//user_id解密

/*转换推荐人
 *author:Code048
 *@param $i_user_id int 当前永固
 *@param $user_tjr_id int 需要修改推荐人的ID
 */
function set_user_tjr($i_user_id = null , $user_tjr_id = null)
{
	$time = date("Y-m-d H:i:s");
	if($i_user_id != $user_tjr_id)//推荐人不能等于自己
	{
		if(!empty($i_user_id) && !empty($user_tjr_id))
		{
			$query = "select * from weixin_users where id=".$i_user_id;
			$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
			
			
			while($row = mysql_fetch_object($result))
			{
				$parent_id = $row->parent_id;
				$gflag = $row->gflag;
			}
			
			$query1 = "select * from weixin_users where id =".$user_tjr_id;
			$p_result = _mysql_query($query1) or die('Query failed: ' . mysql_error());
			
			while($row = mysql_fetch_object($p_result))
			{
				$p_gflag = $row->gflag;
			}
			
			$p_gflag = $p_gflag.$user_tjr_id.",";//转换后基因
			
//			file_put_contents('1.txt',$time."---当前用户id:".$i_user_id."---------------"."转换前基因".$gflag.'----------'."转换前推荐人".$parent_id.PHP_EOL , FILE_APPEND);
//			file_put_contents('1.txt',$time."---当前用户id:".$i_user_id."---------------"."转换后基因".$p_gflag.'----------'."转换后推荐人".$user_tjr_id.PHP_EOL , FILE_APPEND);
			
/*			$arr = explode(',' , $gflag);

			$arr_length = count($arr);
			
			if($arr_length ==3)
			{
				return;
			}
		
			$arr[$arr_length-2] = $user_tjr_id;//替换基因最后一个推荐人
			
			$gflag = implode(',',$arr);//转换后的基因
*/				
			if($parent_id == $user_tjr_id)
			{
				return;
			}
			
			$update_query = "update weixin_users set parent_id ="."'".$user_tjr_id."'"." ,gflag="."'".$p_gflag."'"." where id="."'".$i_user_id."'";
			
//			file_put_contents('1.txt' , '执行SQL语句'.$update_query.PHP_EOL,FILE_APPEND);
//			file_put_contents('1.txt' , PHP_EOL,FILE_APPEND);
			
			
			_mysql_query($update_query);
			
		}
	}
}



// +----------------------------------------------------------------------
// | 默认地址处理
// +----------------------------------------------------------------------
// | @author: Kai <maifakai@jjweb.net>
// +----------------------------------------------------------------------

/**
 * 获取用户信息
 * @author: Kai <maifakai@jjweb.net>
 * @param int $uid
 * @return array | boolean
 */
function get_attusers($uid = null, $customer_id = null){
    $sql = "select * from weixin_users where customer_id=".$customer_id." and id=".$uid;
    $result = _mysql_query($sql) or die('Query failed: ' . mysql_error());
    if (mysql_num_rows($result) > 0) {
        while ($rowi = mysql_fetch_assoc($result)){
            return $rowi;
        }
    }
    return false;
}

/**
 * 获取用户默认收货地址
 * @author: Kai <maifakai@jjweb.net>
 * @param int $user_id
 * @return array | boolean
 */
function get_attusers_addresses($user_id = null){
    $sql = "select * from weixin_commonshop_addresses where user_id=".$user_id." and is_default=1";
    $result = _mysql_query($sql) or die('Query failed: ' . mysql_error());
    if (mysql_num_rows($result) > 0) {
        while ($rowi = mysql_fetch_assoc($result)){
            return $rowi;
        }
    }
    return false;
}

/**
 * 获取用户权限
 * @author: Code048
 * @param int $user_id
 * @return int 
 */
function get_iscommander($user_id)
{
	$auth_query = "select * from promoters where isvalid = 1 and user_id =" .$user_id;
	$auth_result = _mysql_query($auth_query) or die('Query failed: ' . mysql_error()); 

	while($row = mysql_fetch_array($auth_result))
	{
		$is_commander = $row['isAgent'];
	//	print_r($is_commander);
	}	
	return $is_commander;
}

$data_tjr_uid = ''; //推荐人UID
$data_tjr_address = ''; //推荐人默认地址
$data_tjr_detail_address = '';//推荐人详细地址
$data_uid = $_SESSION['user_id_'.$customer_id]; //本人UID
$attusers_addresses = get_attusers_addresses($data_uid);
$data_uid_address = $attusers_addresses ? $attusers_addresses : ''; //本人默认地址

$is_commander = get_iscommander($user_id);//取得当前用户组

if(isset($_REQUEST['exp_user_id']) && !empty($_REQUEST['exp_user_id'])){
	if(empty($is_commander))
	{
		set_user_tjr($data_uid , $_REQUEST['exp_user_id']);//设置用户推荐人
	}
    $tjr = get_attusers($_REQUEST['exp_user_id'], $customer_id);
    $data_tjr_uid = $tjr ? $tjr['id'] : '';
    if(!empty($data_tjr_uid)){
        $attusers_addresses = get_attusers_addresses($data_tjr_uid);
        $data_tjr_address = $attusers_addresses ? $attusers_addresses : '';
//		$data_tjr_detail_address = $attusers_addresses ? $attusers_addresses['detail_address'] : '';
    }
}



if(empty($is_commander))
{
	if (!empty($data_tjr_uid) && !empty($data_tjr_address)) {
		//有推荐人默认地址
		$result = _mysql_query("UPDATE weixin_commonshop_addresses SET is_default=0 WHERE user_id=".$user_id) or die('Query failed: ' . mysql_error());//设现地址无效
		$result = _mysql_query("select * from weixin_commonshop_addresses where user_id=".$data_uid." and name='".$data_tjr_address['name']."'"." and phone='".$data_tjr_address['phone']."'"." and address='".$data_tjr_address['address']."'") or die('Query failed: ' . mysql_error());

	//	$i = $_SESSION['update_address_flag'];
		if (mysql_num_rows($result) > 0) {
			//已存在推荐人地址
			$query = "UPDATE weixin_commonshop_addresses SET is_default=1,detail_address='".$data_tjr_address['detail_address']."' WHERE user_id=".$data_uid." and name='".$data_tjr_address['name']."'"." and phone='".$data_tjr_address['phone']."'"." and address='".$data_tjr_address['address']."'";
//			file_put_contents('/opt/www/weixin_platform/weixinpl/common_shop/jiushop/ceshi.txt' , date('Y-m-d H:i:s').$query.PHP_EOL , FILE_APPEND);
			$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
			

		}else{
			//不存在推荐人地址
			$sql = "insert into weixin_commonshop_addresses(id,user_id,address,isvalid,name,phone,location_p,location_c,location_a,identity,is_default,identityimgt,identityimgf,is_deal,location_diy,detail_address) values ('', '".$data_uid."', '".$data_tjr_address['address']."', '".$data_tjr_address['isvalid']."', '".$data_tjr_address['name']."', '".$data_tjr_address['phone']."', '".$data_tjr_address['location_p']."', '".$data_tjr_address['location_c']."', '".$data_tjr_address['location_a']."', '".$data_tjr_address['identity']."', '1', '".$data_tjr_address['identityimgt']."', '".$data_tjr_address['identityimgf']."', '".$data_tjr_address['is_deal']."', '".$data_tjr_address['location_diy']."','".$data_tjr_address['detail_address']."')";
			$result = _mysql_query($sql) or die('Query failed: ' . mysql_error());
			file_put_contents('/opt/www/weixin_platform/weixinpl/common_shop/jiushop/ceshi.txt' , date('Y-m-d H:i:s').$sql.PHP_EOL , FILE_APPEND);

		}
	}else{
		//没推荐人默认地址
		if (empty($data_uid_address) && empty($data_tjr_address) && !empty($data_tjr_uid)) {
			header('Location: https://www.huisuda.com.cn/weixinpl/common_shop/jiushop/tzchoice.php');
		}
	}	
}


$now_address_query = "SELECT * FROM weixin_commonshop_addresses WHERE is_default=1 AND user_id=".$user_id;
$now_address = _mysql_query($now_address_query) or die('Query failed: ' . mysql_error());
$now_address = mysql_fetch_array($now_address);
$user_address="";
$user_address .=$now_address["location_p"];
$user_address .=$now_address["location_c"];
$user_address .=$now_address["location_a"];
$user_address .=$now_address["address"];


// +----------------------------------------------------------------------
// | 默认地址处理
// +----------------------------------------------------------------------
// | @author: Kai <maifakai@jjweb.net>
// +----------------------------------------------------------------------

//自身推广出去带自己的推广码
$linkurl =$linkurl."&exp_user_id=".passport_encrypt((string)$user_id);

$query="select is_showshare_info,name,template_id,is_attent,attent_url,index_bg,issell,sell_discount,need_online,online_type,online_qq,is_showbottom_menu,gz_url,define_share_image,introduce,nowprice_title,pro_card_level,shop_card_id from weixin_commonshops where isvalid=true and customer_id=".$customer_id;
$shop_name="微商城";
$issell = 0;
$need_online=1;
$online_type = 1;
$online_qq ="";
$sell_discount = 0;
$is_attent=0;
$attent_url="";
$is_showbottom_menu = 1;
$index_bg="";
$is_showshare_info=0;
$gz_url="";
$define_share_image='';
$shop_introduce='';
$base_nowprice_title="";
$pro_card_level=0;//购买产品需要会员卡开关
$shop_card_id=-1;//分销会员卡
$diy_temid = -1; //+ 韦工 11:46 2016/9/3 定义一下，要不出现警告信息
if( !empty($_GET['diy_template_id']) ){
	$diy_temid = $configutil->splash_new($_GET['diy_template_id']);
}
$result = _mysql_query($query) or die('Query failed 1: ' . mysql_error());
while ($row = mysql_fetch_object($result)) {
	$base_nowprice_title  = $row->nowprice_title;
    $template_id          = $row->template_id;

	if(!empty($row->name)){
		$shop_name            = $row->name;
	}

	$issell               = $row->issell;
	$need_online          = $row->need_online;
	$online_type          = $row->online_type;
	$online_qq            = $row->online_qq;
	$sell_discount        = $row->sell_discount;
	$is_attent            = $row->is_attent;
	$attent_url           = $row->attent_url;
	$is_showbottom_menu   = $row->is_showbottom_menu;
	$index_bg             = $row->index_bg;
	$is_showshare_info    = $row->is_showshare_info;
	$gz_url               = $row->gz_url;
	$define_share_image   = $row->define_share_image;
	$shop_introduce       = $row->introduce;		//分享使用商城介绍
	$pro_card_level       = $row->pro_card_level;//购买产品需要会员卡开关
	$shop_card_id         = $row->shop_card_id; //会员卡ID
}

//查找自定义模板的ID
$query_temid="select id,content,bgcolor,default_img,isused from weixin_commonshop_diy_template where isvalid=true and customer_id=".$customer_id;
if( $diy_temid > 0 ){
	$query_temid .= ' and id='.$diy_temid;
} else {
	$query_temid .= ' and isused=true';
}
$result_query_temid=_mysql_query($query_temid) or die ('query_temid faild' .mysql_error());
while($row=mysql_fetch_object($result_query_temid)){
	$diy_temid=$row->id;
	$content=$row->content;
	$bgcolor=$row->bgcolor;
	$default_img=$row->default_img;
	$isused=$row->isused;

	if($default_img==""){
		$default_img="../common/custom_temp/images/loading.gif";
	}
}
if($diy_temid>0){
	$template_id=-1; //假如启用了自定义模板的话，template_id变为-1；
}
$bottomMenu = 1;	//控制底部菜单栏显示，0：不显示，1显示
//
//
// if( $_SESSION['bottomMenu'] == 0 ){
// 	$bottomMenu = $_SESSION['bottomMenu'];
// }
// 自定义模板-新底部菜单控制方法
require_once('../../common/utility_setting_function.php');
	$fun = "diy_template";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish && $diy_temid>0){
		$bottomMenu = 0;
	}
//新底部菜单控制方法

$_SESSION["template_id"] = $template_id;

$_SESSION["issell"] = $issell;
$_SESSION["sell_discount"] = $sell_discount;
//$new_baseurl = BaseURL."back_commonshop/";
//$new_baseurl ="//".$http_host."/weixinpl/back_commonshop/"; //分销无法显示图片
//$new_baseurl ="weixinpl"; //分销无法显示图片
$new_baseurl =Protocol.$http_host; //新UI图片显示

$logo_url="";
$img_1="";
$img_2="";
$img_3="";
$img_4="";
$img_5="";
$img_6="";
$img_7="";
$img_8="";
$img_9="";
$img_10="";
$img_11="";
$img_12="";

$url_1="";
$url_2="";
$url_3="";
$url_4="";
$url_5="";
$url_6="";
$url_7="";
$url_8="";
$url_9="";
$url_10="";
$url_11="";
$url_12="";

$is_shopgeneral=0;
$general_customer_id=-1;
$owner_general = 0;
$orgin_adminuser_id =-1;
$adminuser_id  =-1;
$is_samelevel =0;
$general_template_id = -1;

/*if($template_id==37 or $template_id==6){
	require('../../common/utility_4m.php');
	$u4m = new Utiliy_4m();
	$rearr = $u4m->is_4M($customer_id);

	//是4m分销
	$is_shopgeneral = $rearr[0]  ;
	//厂家编号
	$adminuser_id = $rearr[1] ;
	//是否是厂家总店
	$is_samelevel = $rearr[2] ;
	//总店模板编号
	$general_template_id = $rearr[3] ;
	//总店商家编号
	$general_customer_id = $rearr[4] ;

	//1：厂家总店； 2：代理商总店
	$owner_general = $rearr[5] ;

	$orgin_adminuser_id = $rearr[6] ;
}*/



/***********4M START ***********/

require('../../common/utility_4m.php');
$u4m = new Utiliy_4m_new();//新方法

if($u4m->check_allow_4M_template($template_id)){	//属于4M模板，则加载4M方法

	$rearr = $u4m->is_4M_new($customer_id);
	//是4m分销
	$is_shopgeneral = $rearr[0]  ;
	//厂家编号
	$adminuser_id = $rearr[1] ;
	//是否是厂家总店
	$is_samelevel = $rearr[2] ;
	//总店模板编号
	$general_template_id = $rearr[3] ;
	//总店商家编号
	$general_customer_id = $rearr[4] ;

	//1：厂家总店； 2：代理商总店
	$owner_general = $rearr[5] ;
	//直属代理商编号
	$orgin_adminuser_id = $rearr[6] ;

}
/***********4M END***********/


$exp_user_id=-1;
//是谁推广来的
if(!empty($_GET["exp_user_id"])){
  $exp_user_id = $configutil->splash_new($_GET["exp_user_id"]);
  $_SESSION["exp_user_id_".$customer_id] = $exp_user_id;
}else{
   $_SESSION["exp_user_id_".$customer_id] = -1;
}

$exp_user_id = passport_decrypt($exp_user_id);
//判断推广员是否有效
$exp_user_name="";
$exp_user_headimgurl="";
if($exp_user_id>0){
   $query="select id from promoters where isvalid=true and status=1 and user_id=".$exp_user_id." limit 0,1";
   $result = _mysql_query($query);

   while ($row = mysql_fetch_object($result)) {
        $exp_id = $row->id;
   }
   if($exp_id<0){
       //推广员身份已经失效
       $exp_user_id=-1;
   }

   $query="select name,weixin_name,weixin_headimgurl from weixin_users where isvalid=true and id=".$exp_user_id." limit 0,1";
   $result = _mysql_query($query) or die('Query failed198: ' . mysql_error());
   while ($row = mysql_fetch_object($result)) {
        $wname = $row->name;
		$wweixin_name= $row->weixin_name;
		$wweixin_name= emoji_html_to_unified($wweixin_name); //恢复emoji表情
		$exp_user_headimgurl = $row->weixin_headimgurl;
		$exp_user_name = $wname."(".$wweixin_name.")";
		$exp_user_name = mb_strlen($exp_user_name, 'utf-8') > 13 ? mb_substr($exp_user_name, 0, 13, 'utf-8').'....' : $exp_user_name;	//显示13个字符
   }
}

$owner_id =-1;
$owner_typeids="";
if(!empty($_GET["owner_id"])){
   $owner_id = $configutil->splash_new($_GET["owner_id"]);
}
/*if($owner_id<0){  //解决分类页加载出错问题
  if(!empty($_SESSION["owner_id_".$customer_id])){
     $owner_id= $_SESSION["owner_id_".$customer_id];
	 echo $owner_id."rrrrr";
  }
}*/
$owner_introduce="";


if($owner_id>0){
   $query="select title,online_qq,introduce from weixin_commonshop_owners wco inner join promoters p on p.user_id=wco.user_id where p.status=1 and p.isvalid=true and  wco.isvalid=true and wco.id=".$owner_id;

   $result = _mysql_query($query) or die('Query failed224: ' . mysql_error());
   while ($row = mysql_fetch_object($result)) {
      // $shop_name = $row->title;
	  $online_qq = $row->online_qq;
	  $owner_introduce = $row->introduce;
	  //qq咨询
	  $online_type = 2;
	   $query2="select type_id from weixin_commonshop_owner_types where isvalid=true and owner_id=".$owner_id;
	   $result2 = _mysql_query($query2) or die('Query failed232: ' . mysql_error());
	   while ($row2 = mysql_fetch_object($result2)) {
		   $o_type_id = $row2->type_id;
		   if($owner_typeids==""){
			  $owner_typeids= $owner_typeids.$o_type_id;
		   }else{
			  $owner_typeids= $owner_typeids.",".$o_type_id;
		   }
		   $owner_typeids_son="select id from weixin_commonshop_types where customer_id=".$customer_id." and parent_id=".$o_type_id."";
		   $result_owner_typeids_son = _mysql_query($owner_typeids_son) or die('owner_typeids_son failed: ' . mysql_error());
		   while($row=mysql_fetch_object($result_owner_typeids_son)){
			$owner_typeids_sonid=$row->id;
			$owner_typeids= $owner_typeids.",".$owner_typeids_sonid;
		   }
		  // break;
	   }

   }
   $linkurl=$linkurl."&owner_id=".$owner_id;

   $sql="update weixin_commonshop_owners set exp_url='".$linkurl."' where id=".$owner_id;
   _mysql_query($sql);

   $_SESSION["owner_id_".$customer_id] = $owner_id;
}

$owner_id_link = '';//+ 韦工 11:47 2016/9/3 定义一下，避免未定义警句
if($owner_id<0){  //修改进入index带owner_id的问题
	if(!empty($_SESSION["owner_id_".$customer_id])){
     $owner_id_link= $_SESSION["owner_id_".$customer_id];
	// echo $owner_id."rrrrr";
  }else{
	$query="select id from weixin_commonshop_owners where isvalid=true and user_id=".$user_id;
	$result = _mysql_query($query) or die('Query failed264: ' . mysql_error());
	while ($row = mysql_fetch_object($result)) {
		$owner_id_link = $row->id;
	}

  }
	$linkurl=$linkurl."&owner_id=".$owner_id_link;

}

if( !empty($_GET['diy_template_id']) ){
    if( $diy_temid > 0 ){
        $linkurl=$linkurl."&diy_template_id=".$diy_temid;
    }
}

$new_share_url = Protocol.$http_host."/weixinpl/common_shop/jiushop/index.php?customer_id=".$customer_id_en;

if(empty($owner_introduce)){	//个人微店分享简介
	if(empty($shop_introduce)){
	   $owner_introduce="微信商城，更多优惠，任您选购";
	}else{
	   $owner_introduce= $shop_introduce; //商城简介不为空,则用商城简介
	}

}

//没用代码 不敢屏蔽
$query = "select id,name from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id." order by asort_value desc,id desc limit 0,1";
$result = _mysql_query($query) or die('Query failed284: ' . mysql_error());
$p_img = "";
while ($row = mysql_fetch_object($result)) {
   $name = $row->name;
   $pid = $row->id;

   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
   $result2 = _mysql_query($query2) or die('Query failed291: ' . mysql_error());
   while ($row2 = mysql_fetch_object($result2)) {
	  $p_img= $row2->imgurl;
   }
 }
//没用代码 不敢屏蔽

//多余代码，已封装
 $gz_status=0;
 if(!empty($fromuser)){
	$query5 = "select status from weixin_attusers where isvalid=true and orginid = '".$fromuser."' and customer_id=".$customer_id." limit 0,1";
	$result5 = _mysql_query($query5) or die('Query failed299: ' . mysql_error());
	while ($row5 = mysql_fetch_object($result5)) {
		$gz_status = $row5->status;//判断是否关注公众号
	}
 }
//多余代码，已封装

/*if($owner_id<1){
	$query="select id from weixin_commonshop_owners where isvalid=true and user_id=".$user_id;
	$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
	while ($row = mysql_fetch_object($result)) {
		$owner_id = $row->id;
	}
}
*/
//V7.0分类新排序
$sort_str="";
$type_sort="select sort_str from weixin_commonshop_type_sort where  customer_id=".$customer_id."";
$result_type=_mysql_query($type_sort) or die ('type_sort faild' .mysql_error());
while($row=mysql_fetch_object($result_type)){
   $sort_str=$row->sort_str;
}
$sort_str = rtrim( trim($sort_str),',');

$supporttype=-1; //1代表商城名字 2 代表公众号名字
$supportname="";
$support_fontcolor="";
$support_linkurl="";
$supportImg="";

$support_query="select supporttype,supportname,support_fontcolor,support_linkurl,supportImg from customers where id=".$customer_id."";
$result_support=_mysql_query($support_query) or die ('support_query faild' .mysql_error());
while($row=mysql_fetch_object($result_support)){
$supporttype=$row->supporttype;
$supportname1=$row->supportname;
$support_fontcolor=$row->support_fontcolor;
$support_linkurl=$row->support_linkurl;
$supportImg=$row->supportImg;
}
switch ($supporttype){
case 1:
	$support_name="select name from weixin_commonshops where customer_id=".$customer_id."";
	$result_supportname=_mysql_query($support_name) or die ('support_name faild' .mysql_error());
	while($row=mysql_fetch_object($result_supportname)){
		$supportname=$row->name;
		}
	break;
case 2:
	$support_name="select weixin_name from weixin_baseinfos where customer_id=".$customer_id."";
	$result_supportname=_mysql_query($support_name) or die ('support_name faild' .mysql_error());
	while($row=mysql_fetch_object($result_supportname)){
		$supportname=$row->weixin_name;
		}

	break;
case 3:
	$supportname=$supportname1;
	break;
}


//自定义悬浮窗口  废弃  已封装替换
$ChatFloat_sql = "SELECT ChatFloat_img FROM weixin_widget where customer_id=".$customer_id;
$ChatFloat_res = _mysql_query($ChatFloat_sql);
while($row=mysql_fetch_object($ChatFloat_res)){
	$img = $row->ChatFloat_img;
	if($img==""){
		$ChatFloat_img ='images/MobileChatFloat.png';
	}else{
		$ChatFloat_img = '../../'.$img;
	}
}


//微商城id     没找到使用地方
$sql = "SELECT id FROM weixin_commonshops WHERE isvalid=true AND customer_id=".$customer_id." LIMIT 1";

$res = _mysql_query($sql) or die('Query failed34: ' . mysql_error());
while( $row = mysql_fetch_object($res) ){
	$shop_id = $row->id;    //微商城唯一标识
}
//商城订单提示开关
$shop_logo = "/weixinpl/back_newshops/Common/images/Base/personal_center/gift.png";
$query = "select is_openOrderMessage,logo from weixin_commonshops_extend  where isvalid=true and customer_id=".$customer_id." and shop_id=".$shop_id;
$result = _mysql_query($query) or die('tc_erweima_W116 Query failed: ' . mysql_error());
while ($row = mysql_fetch_object($result)) {
	$is_openOrderMessage = $row->is_openOrderMessage;

	if(!empty($row->logo)){
		$shop_logo       = $row->logo;
	}
}

$buy_query = "select countdown_time,buystart_time from weixin_commonshop_products where customer_id=".$customer_id;
$buy_res = _mysql_query($buy_query) or die('Query failed34: ' . mysql_error());
$k = 0;
$pro_time = [];
while($row = mysql_fetch_object($buy_res)){
	$pro_time[$k]['countdown_time'] = $row->countdown_time;
}
  	echo "<div style='display:hidden'></div>";
?>

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<meta content="telephone=no" name="format-detection">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
<script>
  var template_id=<?php echo $template_id; ?>;
  var page_num=1;
</script>
<title><?php echo $now_address['address']; ?></title>
<link href="../common/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/css/style_common.css" rel="stylesheet" type="text/css">
<link href="css/limit.css" rel="stylesheet" type="text/css">
<link href="css/swiper.min.css" rel="stylesheet" type="text/css">
<style>
    <?php if($_REQUEST['exp_user_id']){ ?>
    .br{border-radius: 5px;}
    <?php }?>
	.hide{display:none;}
</style>
<script src="//res.wx.qq.com/open/js/jweixin-1.3.0.js"></script>
<?php if($template_id>0) { ?>
<script type="text/javascript" src="../../common/js/jquery-1.7.2.min.js"></script>
<?php }else{ ?>
<script type="text/javascript" src="../common/custom_temp/js/jquery-1.12.1.min.js"></script>
<?php }?>
<script type="text/javascript" src="../common/js/global.js"></script>
<script type="text/javascript" src="../common/js/shop.js"></script>
<script type="text/javascript" src="../../common/utility.js" charset="utf-8"></script>
<script type="text/javascript" src="../../common/js/forward_new.js" charset="utf-8"></script>
<?php if($is_openOrderMessage == 1){ ?>
<script type="text/javascript">
var customer_id ='<?php echo $customer_id;?>';
</script>
<script type="text/javascript" src="../../mshop/js/order_message.js?v=<?php echo time(); ?>"></script>
<?php } ?>
<script language="javascript">
$(document).ready(shop_obj.page_init);
</script>

<script type="text/javascript">
	var skin_index_init=null;
<?php if($template_id==1){?>
	var skin_index_init=function(){
	$('#shop_skin_index .menu .nav a.category').click(function(){
		if($('#category').height()>$(window).height()){
			$('html, body, #cover_layer').css({
				height:$('#category').height(),
				width:$(window).width(),
				overflow:'hidden'
			});
		}else{
			$('#category, #cover_layer').css('height', $(window).height());
			$('html, body').css({
				height:$(window).height(),
				overflow:'hidden'
			});
		}

		$('#cover_layer').show();
		$('#category').animate({left:'0%'}, 500);
		$('#shop_page_contents').animate({margin:'0 -70% 0 70%'}, 500);
		window.scrollTo(0);

		return false;
		});
	}
<?php }else if($template_id==2){ ?>
   var skin_index_init=function(){
		$('#shop_skin_index .menu a.category').click(function(){
			if($('#category').height()>$(window).height()){
				$('html, body, #cover_layer').css({
					height:$('#category').height(),
					width:$(window).width(),
					overflow:'hidden'
				});
			}else{
				$('#category, #cover_layer').css('height', $(window).height());
				$('html, body').css({
					height:$(window).height(),
					overflow:'hidden'
				});
			}

			$('#cover_layer').show();
			$('#category').animate({left:'0%'}, 500);
			$('#shop_page_contents').animate({margin:'0 -70% 0 70%'}, 500);
			window.scrollTo(0);

			return false;
		});
        $("#footer .category").click(function(){
            $("#category").css({
                height:$(window).height(),
                overflow:'auto'
            })
        })

	}
	<?php }else if($template_id==3){ ?>
	 //暂时没有
	<?php }else if($template_id==4){ ?>
	//暂时没有
	<?php }else if($template_id==5){ ?>

	<?php }else if($template_id==6){ ?>

	<?php }else if($template_id==8){ ?>

	<?php }else if($template_id==10){ ?>
		var skin_index_init=function(){
			$('#shop_skin_index .banner *').not('img').height($(window).height());
			var sUserAgent = navigator.userAgent.toLowerCase();
			var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
			var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
			var bIsMidp = sUserAgent.match(/midp/i) == "midp";
			var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
			var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
			var bIsAndroid = sUserAgent.match(/android/i) == "android";
			var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
			var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
			if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM){
				$('#index_m').css('position','fixed');
			}
			$('#index_m').show();
		};

	<?php }else if($template_id==11){ ?>
		var skin_index_init=function(){
			$('#shop_skin_index .banner *').not('img').height($(window).height());
			//$('.box').css('position','fixed');
			var w=$('#shop_skin_index').width();
			var box_w=$('.box').width();
			$('.box').show();
		};

	<?php }else if($template_id==15){ ?>
		var skin_index_init=function(){
			$('#shop_skin_index a[name=show_cate]').click(function(){
				if($('#category').height()>$(window).height()){
					$('html, body, #cover_layer').css({
						height:$('#category').height(),
						width:$(window).width(),
						overflow:'hidden'
					});
				}else{
					$('#category, #cover_layer').css('height', $(window).height());
					$('html, body').css({
						height:$(window).height(),
						overflow:'hidden'
					});
				}

				$('#cover_layer').show();
				$('#category').animate({left:'0%'}, 500);
				$('#shop_page_contents').animate({margin:'0 -70% 0 70%'}, 500);
				window.scrollTo(0);

				return false;
			});

			$('.search').click(function(){
				if($('.search_box').is(':hidden')){
					$('.search_box').show();
					$('.head_menu').hide();
				}
			});
		}

		<?php }else if($template_id==29){ ?>



				$(document).ready(function(){
					$('.auto_img').each(function(){
						var $auto_w=$('.auto_img').width();

						//var auto_h=auto_w;
						$('.auto_img').height($auto_w);

					});

				$(window).resize(function(){
					var $auto_w=$('.auto_img').width();
						//var auto_h=auto_w;
						$('.auto_img').height($auto_w);


					var $w_w=$(window).width();
					if($w_w>350){
						$w_w=$w_w-350;
						if($w_w>100){
							$(".headimgurl").width(88);
							$(".headimgurl").height(88);
						}
						else{$(".headimgurl").width(74);$(".headimgurl").height(74);}
					}else{
						$(".headimgurl").width(74);
						$(".headimgurl").height(74);
					}

				});
			});
	<?php }else if($template_id==32){ ?>



				$(document).ready(function(){
					$('.auto_img').each(function(){
						var $auto_w=$('.auto_img').width();

						//var auto_h=auto_w;
						//$('.auto_img').height($auto_w);

					});

				$(window).resize(function(){
					var $auto_w=$('.auto_img').width();
						//var auto_h=auto_w;
						$('.auto_img').height($auto_w);


					var $w_w=$(window).width();
					if($w_w>350){
						$w_w=$w_w-350;
						if($w_w>100){
							$(".headimgurl").width(88);
							$(".headimgurl").height(88);
						}
						else{$(".headimgurl").width(74);$(".headimgurl").height(74);}
					}else{
						$(".headimgurl").width(74);
						$(".headimgurl").height(74);
					}

				});
			});
	<?php }else if($template_id==33){ ?>



				$(document).ready(function(){
					$('.auto_img').each(function(){
						var $auto_w=$('.auto_img').width();

						//var auto_h=auto_w;
						//$('.auto_img').height($auto_w);

					});

				$(window).resize(function(){
					var $auto_w=$('.auto_img').width();
						//var auto_h=auto_w;
						$('.auto_img').height($auto_w);


					var $w_w=$(window).width();
					if($w_w>350){
						$w_w=$w_w-350;
						if($w_w>100){
							$(".headimgurl").width(88);
							$(".headimgurl").height(88);
						}
						else{$(".headimgurl").width(74);$(".headimgurl").height(74);}
					}else{
						$(".headimgurl").width(74);
						$(".headimgurl").height(74);
					}

				});
			});
	<?php } ?>
</script>
<div class="zhezhao" id="zhezhao"></div>
        <div class="zhezhao_loc" id="zhezhao_loc"></div>
        <div class="loading" id="loading"><span>定位中...</span></div>

	<!--悬浮客服-->

<?php
/*weishang-title="<?php echo $shop_name; ?>"
weishang-phone="<?php echo $shop_name; ?>"
weishang-address="<?php echo $owner_introduce; ?>"
weishang-icon="<?php echo $new_baseurl.$p_img; ?>"
weishang-link="<?php echo $linkurl; ?>"*/

if($need_online){
  $online_url="../../online/show_online.php?customer_id=".$customer_id_en;
  if($online_type==2){
     //qq咨询
	  $online_url="http://wpa.qq.com/msgrd?v=3&uin=".$online_qq."&site=qq&menu=yes";
  }

?>
<!--
<style type="text/css">
#ChatFloat{
position: fixed;
right: 0px;
top: 150px;
z-index: 99999;
height: 70px;
width: 65px;
min-width: 65px;
/*background-image: url(images/MobileChatFloat.png);*/
background-image: url(<?php echo $ChatFloat_img;?>);
background-size: 65px;
background-position: 0px 0px;
background-repeat: no-repeat no-repeat;
}
</style>

<?php if($online_type ==3){ ?>
		<div id="ChatFloat" onclick="closewindow();"></div>
<?php	}else{		?>
		<div id="ChatFloat" onclick=""></div>
<?php   }			?>

<script type="text/javascript">
var ChatFloat=document.getElementById('ChatFloat');
        ChatFloat.addEventListener("touchmove", function () {
            event.preventDefault();
            ChatFloat.style.left = (event.targetTouches[0].pageX -document.body.scrollLeft - 30) + "px";
            ChatFloat.style.top = (event.targetTouches[0].pageY - document.body.scrollTop - 30) + "px";
        }, false);
		function closewindow(){  //开启多客服按钮关闭当前页面
			wx.closeWindow();
		}
</script>
-->
<?php } ?>


<?php if($template_id==-1){?>
<!--自定义模板存放的样式JS-->
<link rel="stylesheet" type="text/css" href="../../mshop/css/order_css/global.css">
<link rel="stylesheet" type="text/css" href="../common/custom_temp/css/com.css">
<link rel="stylesheet" type="text/css" href="../common/custom_temp/css/mod.css">
<link rel="stylesheet" type="text/css" href="../common/custom_temp/css/custom.css">
<link rel="stylesheet" type="text/css" href="../common/custom_temp/css/custom2.css?1">
<link rel="stylesheet" type="text/css" href="../common/custom_temp/css/jquery-ui.css">
<?php }else if($template_id==1){?>
<link href="../common/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/css/style_footer.css" rel="stylesheet" type="text/css">

<?php }else if($template_id==2){ ?>
<link href="../common/lingshi/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/lingshi/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/lingshi/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/lingshi/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/css/style_footer.css" rel="stylesheet" type="text/css">

<?php }else if($template_id==3){ ?>

<link href="../common/bao/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/bao/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/bao/css/global.css.css" rel="stylesheet" type="text/css">
<link href="../common/bao/css/flexslider.css" rel="stylesheet" type="text/css">

<?php }else if($template_id==4){ ?>
<link href="../common/fushi/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/fushi/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/fushi/css/products.css" rel="stylesheet" type="text/css">
<link href="../common/fushi/css/products_media.css" rel="stylesheet" type="text/css">

<?php }else if($template_id==5){ ?>

<link href="../common/huazhuang/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang/css/style.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang/css/products.css" rel="stylesheet" type="text/css">

<?php }else if($template_id==6){ ?>

<link href="../common/huazhuang2/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang2/css/product.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang2/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang2/css/style.css" rel="stylesheet" type="text/css">
<link href="../common/css/style_footer.css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==7){ ?>

<link href="../common/huazhuang3/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang3/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/css/style_footer.css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==8){ ?>

<link href="../common/lvyou/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/lvyou/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/lvyou/css/style(1).css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==9){ ?>

<link href="../common/tupian/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/tupian/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/tupian/css/style(1).css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==10 or $template_id==20){ ?>

<link href="../common/fushi2/css/style.css" rel="stylesheet" type="text/css">
<link href="../common/fushi2/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/fushi2/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/fushi2/css/global(1).css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==11){ ?>

<link href="../common/fushi3/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/fushi3/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/fushi3/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/fushi3/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/fushi3/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/fushi3/css/global(1).css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==12){ ?>

<link href="../common/small/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/small/css/style(1).css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==13){ ?>

<link href="../common/jiazhuang/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/jiazhuang/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/jiazhuang/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/jiazhuang/css/global.css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==14){ ?>

<link href="../common/fushi6/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/fushi6/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/fushi6/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/fushi6/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/fushi6/css/style(1).css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==15){ ?>

<link href="../common/xie2/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/xie2/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/xie2/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/xie2/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/xie2/css/global.css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==16){ ?>

<link href="../common/fushi7/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/fushi7/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/fushi7/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/fushi7/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/fushi7/css/global.css.css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==17){ ?>

<link href="../common/huazhuang5/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang5/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang5/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang5/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang5/css/global.css" rel="stylesheet" type="text/css">

 <?php }else if($template_id==18){ ?>

<link href="../common/fruit/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/fruit/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/fruit/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/fruit/css/global.css" rel="stylesheet" type="text/css">

<?php }else if($template_id==26){ ?>

<link href="../common/huazhuang5_1/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang5_1/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang5_1/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang5_1/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/huazhuang5_1/css/global.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==27){ ?>
<link href="../common/fushi_27/css/jquery.bxslider.css" rel="stylesheet" />
<link  rel="stylesheet"  href="../common/fushi_27/css1/style.css">
<link  rel="stylesheet"  type="text/css"  href="../common/fushi_27/css1/idangerous.swiper.css">
<link  rel="stylesheet"  href="../common/fushi_27/css1/header_style5.css">
<!--link href="../common/fushi2/css/shop.css" rel="stylesheet" type="text/css">-->
<link href="../common/fushi_27/css/index.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="../common/fushi_27/js/jqueryrotate.js"></script>
 <?php }else if($template_id==28){ ?>

<link href="../common/bao/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/bao/css/style(1).css" rel="stylesheet" type="text/css">
<link href="../common/bao/css/global.css.css" rel="stylesheet" type="text/css">
<link href="../common/bao/css/flexslider.css" rel="stylesheet" type="text/css">

<?php }else if($template_id==29){ ?>

<link href="../common/yzzj/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj/css/style_footer.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../common/yzzj/css/mall.css">

<?php }else if($template_id==30){ ?>

<link href="../common/lingshi/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/lingshi/css/index1.css" rel="stylesheet" type="text/css">
<link href="../common/lingshi/css/index_media.css" rel="stylesheet" type="text/css">
<link href="../common/lingshi/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/css/style_footer.css" rel="stylesheet" type="text/css">

<?php }else if($template_id==31){ ?>
    <link href="../common/fengge31/css/index.css" rel="stylesheet" type="text/css">
	<link href="../common/fengge31/css/style.css" rel="stylesheet" type="text/css">
	<link href="../common/css/style_footer.css" rel="stylesheet" type="text/css">

<?php }else if($template_id==32){ ?>

<link href="../common/yzzj2/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj2/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj2/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj2/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj2/css/style_footer.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../common/yzzj2/css/mall.css">

<?php }else if($template_id==33){ ?>

<link href="../common/yzzj3/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj3/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj3/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj3/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj3/css/style_footer.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../common/yzzj3/css/mall.css">

<?php }else if($template_id==34){ ?>
    <link href="../common/fengge34/css/PreFoot.css" rel="stylesheet" type="text/css">
	<link href="../common/fengge34/css/scroll.css" rel="stylesheet" type="text/css">
	<link href="../common/fengge34/css/style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="../common/fengge34/js/PreFoot.js"></script>
    <script type="text/javascript" src="../common/fengge34/js/scroll.js"></script>
<?php }else if($template_id==35){ ?>
<link href="../common/yzzj4/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/style_footer.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../common/yzzj4/css/mall.css">

<?php }else if($template_id==36){ ?>
<link href="../common/yzzj4/css/flexslider.css" rel="stylesheet" type="text/css">

<link href="../common/yzzj4/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/style_footer.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../common/yzzj4/css/mall.css">
<link href="../common/fengge36/css/index.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="../common/fengge36/css/base_index.css">
<link rel="stylesheet" href="../common/fengge36/css/showcase_index.css">
<link rel="stylesheet" href="../common/fengge36/css/index_36.css">

<?php }else if($template_id==37){ ?>
<link href="../common/yzzj4/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/style_footer.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../common/yzzj4/css/mall.css">
<link rel="stylesheet" href="../common/fengge37/css/index.css"  type="text/css">
<link rel="stylesheet" href="../common/fengge37/css/base_index.css">
<link rel="stylesheet" href="../common/fengge37/css/showcase_index.css">
<link rel="stylesheet" href="../common/fengge37/css/index_36.css">
<link rel="stylesheet" href="../common/fengge37/css/PreFoot.css">
<?php }else if($template_id==38){ ?>
<link href="../common/fengge38/css/PreFoot.css" rel="stylesheet" type="text/css">
<link href="../common/fengge38/css/scroll.css" rel="stylesheet" type="text/css">
<link href="../common/fengge38/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==39){ ?>
<link href="../common/fengge39/css/style.css" rel="stylesheet" type="text/css">
<link href="../common/fengge39/css/index.css" rel="stylesheet" />
<?php }else if($template_id==40){ ?>
<link href="../common/fengge40/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==41){ ?>
<link href="../common/fengge41/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==42){ ?>
<link href="../common/fengge42/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==43){ ?>
<link href="../common/fengge43/css/common.css" rel="stylesheet" type="text/css">
<link href="../common/fengge43/css/detail3.css" rel="stylesheet" type="text/css">
<link href="../common/fengge43/css/font-awesome.css" rel="stylesheet" type="text/css">
<link href="../common/fengge43/css/idangerous.swiper.css" rel="stylesheet" type="text/css">
<link href="../common/fengge43/css/reset.css" rel="stylesheet" type="text/css">
<link href="../common/fengge43/css/weimobfont2.css" rel="stylesheet" type="text/css">
<link href="../common/fengge43/css/wicons.css" rel="stylesheet" type="text/css">
<link href="../common/fengge43/css/widget_menu.css" rel="stylesheet" type="text/css">
<link href="../common/fengge43/css/widget_public.css" rel="stylesheet" type="text/css">
<link href="../common/fengge43/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==44){ ?>
<link href="../common/yzzj4/css/flexslider.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/yzzj4/css/style_footer.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../common/yzzj4/css/mall.css">
<link rel="stylesheet" href="../common/fengge44/css/index.css"  type="text/css">
<link rel="stylesheet" href="../common/fengge44/css/base_index.css">
<link rel="stylesheet" href="../common/fengge44/css/showcase_index.css">
<link rel="stylesheet" href="../common/fengge44/css/index_36.css">
<link rel="stylesheet" href="../common/fengge44/css/PreFoot.css">
<?php }else if($template_id==45){ ?>
<link href="../common/fengge45/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/fengge45/css/style1.css" rel="stylesheet" type="text/css">
<link href="../common/fengge45/css/style.css" rel="stylesheet" type="text/css">
<link href="../common/css/style_footer.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==46){ ?>
<!--<link href="../common/fengge46/css/shop.css" rel="stylesheet" type="text/css">-->
<link href="../common/fengge46/css/global.css" rel="stylesheet" type="text/css">
<link href="../common/fengge46/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==47){ ?>
<link href="../common/fengge47/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==48){ ?>
<link href="../common/fengge48/amazeui.css" rel="stylesheet" type="text/css">
<link href="../common/fengge48/index.css" rel="stylesheet" type="text/css">
<link href="../common/fengge48/shop.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==49){ ?>
<link href="../common/fengge45/css/index.css" rel="stylesheet" type="text/css">
<link href="../common/fengge45/css/style.css" rel="stylesheet" type="text/css">
<link href="../common/css/style_footer.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==50){ ?>
<link href="../common/fengge50/amazeui.css" rel="stylesheet" type="text/css">
<link href="../common/fengge50/index.css" rel="stylesheet" type="text/css">
<link href="../common/fengge50/shop.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==51){ ?>
<link href="../common/fengge51/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==52){ ?>
<link href="../common/fengge52/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==53){ ?>
<link rel="stylesheet" href="../common/fengge53/css/style.css">
<?php }else if($template_id==54){ ?>
<link href="../common/fengge54/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==55){ ?>
<link href="../common/fengge55/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==56){ ?>
<link href="../common/fengge56/css/style.css" rel="stylesheet" type="text/css">
<?php }else if($template_id==57){ ?>
<link href="../common/fengge57/css/style.css" rel="stylesheet" type="text/css">
<?php } ?>

</head>

<style>
  .loading {
        width: 180px;
        height: 100px;
        top: 50%;
        margin-top: -50px;
        position: fixed;
        background: url('images/loading.gif');
        display: none;
        left: 50%;
        background-size: 100%;
        background-position: 50% 50%;
        margin-left: -90px;
        background-position-y: -34px;
        z-index: 10001;
        border-radius: 10px;
        opacity: 0.8;
    }
    .zhezhao,.zhezhao_loc {
        width:100%;
        height:100%;
        background-color:#000;
        filter:alpha(opacity=50);
        -moz-opacity:0.5;
        opacity:0.5;
        position:fixed;
        left:0px;
        top:0px;
        display:none;
        z-index:10000;
    }
    .loading span {
        display: inline-block;
        bottom: 12px;
        left: 50%;
        margin-left: -30px;
        position: absolute;
        color: #555555;
    }
</style>
<!-- <body onscroll="onscrollFun()" style="padding-bottom:80px;"> -->
<body>
<div class="order_message hide" id="order_message" style="background-color: rgba(0,0,0,0.7);border-radius: 30px;height:30px;position:fixed;top: 52px;left: 10px;z-index: 10;">
	<img style="width: 24px;height: 24px;border-radius: 50%;vertical-align: middle;margin:2px 3px;display: inline-block;" src="/weixinpl/mshop/images/dalibao.jpg"/>
	<p style="color: #ffffff;font-size: 12px;display: inline-block;margin: 0;vertical-align: middle;padding-right: 7px;"><span style="width:46px;display:inline-block;vertical-align:middle;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;margin-right: 5px;">瞪圆德惠</span><span style="display:inline-block;vertical-align:middle;">下了一笔订单</span><span style="display:inline-block;vertical-align:middle;margin-left: 5px;">5分钟前</span></p>
</div>
<div id="shop_page_contents">
<div id="cover_layer"></div>
<script type="text/javascript" src="../common/js/flexslider.js"></script>
 <script type="text/javascript" src="../common/js/index5.js"></script>
<?php include_once($_SERVER['DOCUMENT_ROOT'].'/mp/geolocation.php'); ?>
<script language="javascript">
var owner_id ='<?php echo $owner_id;?>';
var fromuser ="<?php echo $fromuser;?>";
var from_type ='<?php echo $from_type;?>';
<?php
$s = '';
/* redis 配置 start */
require_once($_SERVER['DOCUMENT_ROOT'].'/mp/function_redis.php');
/* redis 配置 end */

  if($template_id>0){ //使用了常规模板
    $shop_skin_data = redis_get("shop_template_data_{$customer_id}_{$template_id}");  //读取redis缓存模板数据

    if (!$shop_skin_data) {
	  // echo "var shop_skin_data=[";
	  $shop_skin_data = "var shop_skin_data=[";
	  $query="select id,imgurl,default_imgurl,contenttype,title,width,height,position,needlink,url,linktype from weixin_commonshop_template_imgs where isvalid=true and template_id=".$template_id;
	  //echo $query;
	  $result = _mysql_query($query) or die('Query failed: ' . mysql_error());
	  $rcount = mysql_num_rows($result);
	  $n=1;
	  while ($row = mysql_fetch_object($result)) {
		  $id				=	$row->id;
		  $imgurl			=	$row->imgurl;
		  $contenttype		=	$row->contenttype;
		  $title 			=	 $row->title;
		  $width 			= 	$row->width;
		  $height 			= 	$row->height;
		  $position 		= 	$row->position;
		  $needlink 		= 	$row->needlink;
		  $default_imgurl	= 	$row->default_imgurl;
		  $url				=	$row->url;
		  $imgurl = $default_imgurl;

		 //如果客户已经替换了图片，则用客户的图片

		 /* 4m属性 start*/
		 $is_4m				=	0;
		 $template_4m_id	=	-1;
		 /* 4m属性 end*/
		  $query2="select id,imgurl,position,url,linktype,foreign_id,title,video_link,is_4m,template_4m_id from weixin_commonshop_template_item_imgs where isvalid=true  and template_id=".$template_id." and customer_id=".$customer_id." and position=".$position." order by id desc LIMIT 0,1";
		  //echo $query2;
		  $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
		  while ($row2 = mysql_fetch_object($result2)) {

			  $id				=	$row2->id;
			  $imgurl			=	$row2->imgurl;
			  $url				=	$row2->url;
			  $linktype 		= 	$row2->linktype;
			  $foreign_id		= 	$row2->foreign_id;
			  $title 			= 	$row2->title;
			  $video_link 		= 	$row2->video_link;
			   /* 4m属性 start*/
			  $is_4m			=	$row2->is_4m;
			  $template_4m_id	=	$row2->template_4m_id;
			   /* 4m属性 end*/
		  }

		  //如果客户已经加了字体颜色
		  $query3="select font_color from weixin_commonshop_type_font where isvalid=true and template_id=".$template_id." and font_id=".$id." LIMIT 0,1";
		  $result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
		  $font_color="000000";
		  while ($row3 = mysql_fetch_object($result3)) {
			   $font_color=$row3->font_color;
		  }

		  switch($position){
			  case 1:
				$img_1 = $imgurl;
				$url_1= $url;
				break;
			  case 2:
				$img_2 = $imgurl;
				$url_2= $url;
				break;
			  case 3:
				$img_3 = $imgurl;
				$url_3= $url;
				break;
			  case 4:
			   $img_4 = $imgurl;
			   $url_4= $url;
				break;
			  case 5:
				$img_5 = $imgurl;
				$url_5= $url;
				break;
			  case 6:
				$img_6 = $imgurl;
				$url_6= $url;
				break;
			 case 7:
				$img_7 = $imgurl;
				$url_7= $url;
				break;
			case 8:
				$img_8 = $imgurl;
				$url_8= $url;
				break;
			case 9:
				$img_9 = $imgurl;
				$url_9= $url;
				break;
			case 10:
				$img_10 = $imgurl;
				$url_10= $url;
				break;
			case 11:
				$img_11 = $imgurl;
				$url_11= $url;
				break;
			case 12:
				$img_12 = $imgurl;
				$url_12= $url;
				break;
		  }

		  // echo "{\"PId\":\"".$id."\"";
		  // echo ",\"SId\":\"".$template_id."\"";
		  // echo ",\"MemberId\":\"".$customer_id."\"";
		  // echo ",\"ContentsType\":\"".$contenttype."\"";
		  // echo ",\"Title\":\"".$title."\"";
		  // echo ",\"Video_link\":\"".$video_link."\"";
		  //输出文字颜色
		  // echo ",\"font_color\":\"".$font_color."\"";
          $shop_skin_data .= "{\"PId\":\"".$id."\"";
		  $shop_skin_data .= ",\"SId\":\"".$template_id."\"";
		  $shop_skin_data .= ",\"MemberId\":\"".$customer_id."\"";
		  $shop_skin_data .= ",\"ContentsType\":\"".$contenttype."\"";
		  $shop_skin_data .= ",\"Title\":\"".$title."\"";
		  $shop_skin_data .= ",\"Video_link\":\"".$video_link."\"";
		  //输出文字颜色
		  $shop_skin_data .= ",\"font_color\":\"".$font_color."\"";

		 /* $general_imgurl = "";
		  if($is_shopgeneral and $general_customer_id>0 and ($template_id==37 or $template_id==6) and $is_samelevel==0){
			//查找总部幻灯片
			$query2="select id,imgurl,position,url,linktype,foreign_id,title from weixin_commonshop_template_item_imgs where isvalid=true  and template_id=".$template_id." and (customer_id=".$general_customer_id.") and position=".$position." limit 0,1";
			$result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
			while ($row2 = mysql_fetch_object($result2)) {

				  $general_imgurl=$row2->imgurl;
				  //$url=$row2->url;
				 // echo "url=======".$url."\r\n";
				  //$linktype = $row2->linktype;
			 }
			 if(!empty($general_imgurl)){
			 //$imgurl  = $general_imgurl."|*|".$imgurl;
				 if($contenttype==1){


					 $imgurl = $general_imgurl."|*|".$imgurl;
				 }else{
					 if(!empty($general_imgurl)){
						$imgurl = $general_imgurl;
					 }
				 }

			  }
		  }*/

	/******* 4M START *******/

	if($u4m->check_allow_4M_template($template_id)){

		if($is_shopgeneral == 1  and $general_customer_id>0 and $is_samelevel==0){	//非厂家总店

	  // if($template_id==37 or $template_id==6 ){

			//查找厂家总店的幻灯片
			/*$is_4m = 0;
			$template_4m_id = -1;
			$query2="select id,imgurl,is_4m,template_4m_id from weixin_commonshop_template_item_imgs where isvalid=true  and template_id=".$template_id." and customer_id=".$customer_id." and position=".$position."  limit 1";
			//echo $query2;
			$result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
			while ($row2 = mysql_fetch_object($result2)) {
				  $general_imgurl	=	$row2->imgurl;
				  $is_4m			=	$row2->is_4m;
				  $template_4m_id	=	$row2->template_4m_id;
			}*/

			if($is_4m){
				if($template_4m_id>0){
					$query3 = "select content,imgurl,url,foreign_id,linktype from weixin_commonshop_4m_template where isvalid=true and id=".$template_4m_id."";
					//echo $query3;
					$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
					while ($row3 = mysql_fetch_object($result3)) {
						  $Fac_imgurl		=	$row3->imgurl;			//产家图片、轮播图
						  $Fac_url			=	$row3->url;				//产家轮播图链接设置
						  $Fac_foreign_id	=	$row3->foreign_id;		//产家轮播图链接设置
						  $Fac_linktype		=	$row3->linktype;		//
					}
				}
				if($contenttype==1){	//轮播图
					 if(!empty($Fac_imgurl)){
						 $imgurl 		= $u4m->auto_fill_str($imgurl,4,'|*|').'|*|'.$Fac_imgurl;
						 $url 			= $u4m->auto_fill_str($url,4,'|*|').'|*|'.$Fac_url;
						 $foreign_id 	= $u4m->auto_fill_str($foreign_id,4,'|*|').'|*|'.$Fac_foreign_id;
						 $linktype 		= $u4m->auto_fill_str($linktype,4,'|*|').'|*|'.$Fac_linktype;
					 }
				}else{					//普通图片
				   if(!empty($Fac_imgurl)){
						 $imgurl = $Fac_imgurl;
					 }
				}
				// echo ",\"Fac_imgurl\":\"".$Fac_imgurl."\"";
				// echo ",\"Fac_url\":\"".$Fac_url."\"";
				// echo ",\"Fac_foreign_id\":\"".$Fac_foreign_id."\"";
                $shop_skin_data .= ",\"Fac_imgurl\":\"".$Fac_imgurl."\"";
				$shop_skin_data .= ",\"Fac_url\":\"".$Fac_url."\"";
				$shop_skin_data .= ",\"Fac_foreign_id\":\"".$Fac_foreign_id."\"";
			}
		}
	}

	/******* 4M END *******/


		 $imgarr = explode("|*|",$imgurl);
		 //echo "\r\n contentype====".$contenttype."==imgarr====".$imgurl;
		 $icount = count($imgarr);
		 $find="ttp";

		if($icount==1){
			 // echo ",\"ImgPath\":\"".$imgurl."\"";
			 $shop_skin_data .= ",\"ImgPath\":\"".$imgurl."\"";
		  }else{
			 // echo ",\"ImgPath\":[";
			 $shop_skin_data .= ",\"ImgPath\":[";
			 for($i=0;$i<$icount; $i++){
				$img = $imgarr[$i];
				// echo "\"".$img."\"";
				$shop_skin_data .= "\"".$img."\"";
				if($i<$icount){
				   // echo ",";
				   $shop_skin_data .= ",";
				}
			 }
			 // echo "]";
			 $shop_skin_data .= "]";
		  }

		 /* if($icount==1){
			   if(strpos($imgurl,$find)!=false){$imgurl=$imgurl; }else{$imgurl="weixinpl".$imgurl;}
			 echo ",\"ImgPath\":\"".$imgurl."\"";
		  }else{
			 echo ",\"ImgPath\":[";
			 for($i=0;$i<$icount; $i++){
				$img = $imgarr[$i];
				 if(strpos($img,$find)!=false){$img=$img; }else{$img="weixinpl".$img;}
				echo "\"".$img."\"";
				if($i<$icount){
				   echo ",";
				}
			 }
			 echo "]";
		  }*/
		  /*$tpos = strpos($url,"?");
		  if($tpos>0){
			$url = $url."&fromuser=".$fromuser;
		  }else{
			$url = $url."?fromuser=".$fromuser;
		  }*/
          // echo ",\"Url\":\"".$url."\"";
		  // echo ",\"Postion\":\"".$position."\"";
		  // echo ",\"Width\":\"".$width."\"";
		  // echo ",\"Height\":\"".$height."\"";
		  // echo ",\"NeedLink\":\"".$needlink."\"";
		  // echo "}";
		  $shop_skin_data .= ",\"Url\":\"".$url."\"";
		  $shop_skin_data .= ",\"Postion\":\"".$position."\"";
		  $shop_skin_data .= ",\"Width\":\"".$width."\"";
		  $shop_skin_data .= ",\"Height\":\"".$height."\"";
		  $shop_skin_data .= ",\"NeedLink\":\"".$needlink."\"";
		  $shop_skin_data .= "}";
		  if($n<$rcount){
			 // echo ",";
			 $shop_skin_data .= ",";
		  }
		  $n++;


	  }
	// echo "];";
	$shop_skin_data .= "];";
    redis_set("shop_template_data_{$customer_id}_{$template_id}", $shop_skin_data, 60);  //保存模板数据到redis
      }

    echo $shop_skin_data;
	//echo "console.log(shop_skin_data);";

  }else{ //使用了自定义模板
        $customarr = redis_get("shop_diytemplate_data_{$customer_id}_{$diy_temid}"); //读取redis缓存模板数据

        if (empty($customarr)) {    //redis缓存为空则重新获取模板数据
            $k=0;
            $customarr = [];
            $custom_query="select diy_tem_contid,title,imgurl,mod_padding,mod_img_padding,foreign_id,css_type,pro_title_show,pro_title_twoline,pro_numshow,foot_position,placeholder,show_sale,type,link,search_color,color,video_link,rolling_direction,rolling_speed,show_time_limit,city_name,start_time,end_time,shop_type,sort_type,divide_type from weixin_commonshop_diy_template_content where customer_id=".$customer_id." and LOCATE(diy_tem_contid,'".$content."') ORDER  BY FIND_IN_SET(diy_tem_contid,'".$content."')";
            $result_custom=_mysql_query($custom_query) or die ('custom_query faild' .mysql_error());
            while($row=mysql_fetch_object($result_custom)){
                $customarr[$k]['diy_tem_contid']=$row->diy_tem_contid;
                $customarr[$k]['title']=$row->title;
                $customarr[$k]['imgurl']=$row->imgurl;
                $customarr[$k]['mod_padding']=$row->mod_padding;
                $customarr[$k]['mod_img_padding']=$row->mod_img_padding;
                $customarr[$k]['foreign_id']=$row->foreign_id;  //保存产品 模块的显示分类
                $customarr[$k]['css_type']=$row->css_type;
                $customarr[$k]['pro_title_show']=$row->pro_title_show;
                $customarr[$k]['pro_title_twoline']=$row->pro_title_twoline;
                $customarr[$k]['pro_numshow']=$row->pro_numshow;
                $customarr[$k]['foot_position']=$row->foot_position;
                $customarr[$k]['placeholder']=$row->placeholder;
                $customarr[$k]['show_sale']=$row->show_sale;
                $customarr[$k]['type']=$row->type;
                $customarr[$k]['link']=$row->link;
                $customarr[$k]['bg_color']=$row->search_color;
                $customarr[$k]['color']=$row->color;
                $customarr[$k]['video_link']=$row->video_link;
                $customarr[$k]['rolling_direction']=$row->rolling_direction;
                $customarr[$k]['rolling_speed']=$row->rolling_speed;
                $customarr[$k]['show_time_limit']=$row->show_time_limit;
                $customarr[$k]['city_name']=$row->city_name;
                $customarr[$k]['start_time']=$row->start_time;
                $customarr[$k]['end_time']=$row->end_time;
                $customarr[$k]['shop_type']=$row->shop_type;
                $customarr[$k]['sort_type']=$row->sort_type;
                $customarr[$k]['divide_type']=$row->divide_type;
                $k++;
            }

            redis_set("shop_diytemplate_data_{$customer_id}_{$diy_temid}", $customarr, 60);    //保存模板数据到redis
        }
  }
  $now_time = time();	//当前时间戳

?>
<?php if($template_id>=0){?>
	$(document).ready(index_obj.index_init);
<?php }?>
</script>

<?php
	if($template_id==-1){
	require_once('../../mshop/select_skin.php');
?>
<script>
document.body.style.backgroundColor="<?php echo $bgcolor;?>";
</script>
<link type="text/css" rel="stylesheet" href="../../mshop/css/css_<?php echo $skin ?>.css" />
<style>
/*滚动公告栏*/
.marquee{height:40px;line-height:40px;overflow:hidden;margin:0 auto;}
.marquee ul{height:40px;line-height:40px;font-size:0;}
.marquee ul li{padding:0 10px;line-height:40px;height:40px;overflow:hidden;text-align:left;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;}

/*线下店铺--*/
.shop-content{background: #FFFFFF;padding: 10px;font-size: 0;margin-bottom: 10px;position:relative;padding-bottom:4px;}
    	.shop-info{display: inline-block;width: 73%;vertical-align: middle;margin-left: 2%;}
    	.shop-info p ,.star-grade{height: 20px;line-height: 20px;}
    	.star{display: inline-block;width: 64px;height: 12px;background-image: url(../../city_area/shop/images/star_normal5.png);background-repeat: no-repeat;background-size: 100% 100%;margin-top: 4px;}
        .star .select{    height: 100%;overflow-x: hidden;border:none;background:none;padding:0;vertical-align:top;display:block;}
        .star2{width: 64px;height: 12px;background-image: url(../../city_area/shop/images/star_select5.png);background-repeat: no-repeat;background-size: 100% 100%;}
        .shop-content img{width: 25%;height: 75px;vertical-align: middle;}
        .shop-name{font-size: 14px;color: #646464;}
        .p3{color: #646464;font-size: 0;}
        .p3 span{display: inline-block;font-size: 12px;}
        .condition01{width: 48%;}
        .condition02{width: 30%;}
        .condition03{width: 22%;text-align: right;}
        .pf{font-size: 12px;color: #ff9126;margin-left: 10px;}
        .small{width:15px !important;height:15px !important;position:absolute;top:10px;left:24%;}
        .span-img{max-width: 90px;width:41% !important;height: 15px !important;display: inline-block;border: 1px solid #c1c1c1;border-radius: 2px;}
        .daodianfu{border-radius:3px;-moz-border-radius: 3px;-webkit-border-radius: 3px;font-size:11px;color:#fff;background-color:#2dacf1;padding:1px 2px 1px 2px;}
        .line{margin:8px 10px 0px 10px; height:1px;background-color:#e4e4e4;}
        .shop-action{padding:3px 10px 0px 10px;background-color: #fff;}
.shop-action.content{color:#2a2a2a;font-size:14px;line-height:29px;height:25px;padding-right:20px;display:inline-block;vertical-align:top;width:70%;}
        .shop-action .arrow{width:12px;height:12px;background-image: url("../../city_area/shop/images/arrow_right_gray.png");background-repeat: no-repeat;background-size:100% 100%;float:right;margin-top:-20px;}
        .icon{height:25px;line-height:25px;display:inline-block;vertical-align:top;}
        .shop-url{font-size:0;}
#cart_num{
	position: absolute;
    top: 0px;
	margin-left: -5px;
	background-color:#ff8430;
    font-size: 10px;
    color: white;
    border-radius: 100px;
    width: 18px;
    height: 18px;
    white-space: nowrap;
    text-align: center;
	line-height: 18px;
	}
</style>
<!--自定义模板内容-->
<div class="WSY_main" style="background:<?php echo $bgcolor;?>;overflow-x:hidden"></div>
<div class="WSY_main_foot" style="background:<?php echo $bgcolor;?>"></div>
<!--搜索框-->
<script  type="dot-template" id="type_con_1">

<div class="con_display" style="{{? it.content.padding}}padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px;{{?}}background-color:{{= it.content.bg_color}}">
{{? it.content.css_type==1}}
<div class="search-box-1">
<div class="search-layer-1">
    <input type="text" class="search-input-1" id="searchname" onkeydown="if(event.keyCode==13){search_name();}" placeholder="{{= it.content.placeholder }}" >
    <button type="submit" class="search-icon-1" onclick="javascript:search_name()"></button>
</div>
</div>
{{?? it.content.css_type==2}}
<div class="search-box-2">
<a title="{{=it.content.dataset[0].title}}" href="{{=it.content.dataset[0].link}}" ><img src="{{=it.content.dataset[0].pic}}" width="100%" class="search-logo"/></a>
<div class="search-layer-2">

    <input type="text" class="search-input-2" id="searchname" onkeydown="if(event.keyCode==13){search_name();}" placeholder="{{= it.content.placeholder }}" >
    <button type="submit" class="search-icon-2" onclick="javascript:search_name();"></button>
</div>
</div>
{{?? it.content.css_type==3}}
<div class="search-box-3">
<a title="{{=it.content.dataset[0].title}}" href="{{=it.content.dataset[0].link}}" ><img src="{{=it.content.dataset[0].pic}}" width="100%" class="search-logo"/></a>
<div class="search-layer-3">

    <input type="text" class="search-input-3" id="searchname" onkeydown="if(event.keyCode==13){search_name();}" placeholder="{{= it.content.placeholder }}" >
    <button type="submit" class="search-icon-3" onclick="javascript:search_name();"></button>
</div>
</div>
{{?? it.content.css_type==4}}
<div class="bg_style4" style="{{? it.content.bg_color=="#fff"}}background-color:#fd4000{{?}};height:40px">
    <div class="search-box-4">
		<div class="search-layer-4">
			<input type="text" class="search-input-4" id="searchname" onkeydown="if(event.keyCode==13){search_name();}" placeholder="{{= it.content.placeholder }}" >
		</div>
    </div>
	<div class="search-icon-4" onclick="javascript:search_name();" >
		<span onclick="javascript:search_name();"></span>
	</div>
</div>
{{?? it.content.css_type==5}}
<div class="bg_style5" style="{{? it.content.bg_color=="#fff"}}background-color:#fd4000{{?}}">
    <div class="search-box-5">
    <a title="{{=it.content.dataset[0].title}}" href="{{=it.content.dataset[0].link}}" ><img src="{{=it.content.dataset[0].pic}}" width="100%" class="search-logo5"/></a>
    <div class="search-layer-5" >
        <input type="text" class="search-input-5" id="searchname" onkeydown="if(event.keyCode==13){search_name();}" placeholder="{{= it.content.placeholder }}" >
        <button type="submit" class="search-icon-5" onclick="javascript:search_name();"></button>
    </div>
    </div>
</div>
{{?}}
</div>
</script>
<!--图片广告-->
<script  type="dot-template" id="type_con_2">
<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px"{{?}}>
{{? it.content.css_type==1&&it.content.dataset.length!=1}}
<div id="banner_tabs" class="flexslider">
    <ul class="slides">
    {{ for(var i=0,l=it.content.dataset.length;i<l;i++) { }}
        <li><a title="{{=it.content.dataset[i].title}}" href="{{=it.content.dataset[i].link}}" ><img src="{{=it.content.dataset[i].pic}}?x-oss-process=image/resize,w_850" width="100%" /></a></li>
    {{}}}
    </ul>
    <ul class="flex-direction-nav" style="display:none;">
        <li><a class="flex-prev" id="btn_prev" href="javascript:;"></a></li>
        <li><a class="flex-next" id="btn_next" href="javascript:;"></a></li>
    </ul>
</div>
{{?? it.content.css_type==2||it.content.dataset.length==1}}
<section class="members_imgad">
<ul class="img-box clearfix">
 {{ for(var i=0,l=it.content.dataset.length;i<l;i++) { }}
<li {{? it.content.margin}} style="margin-bottom:{{= it.content.margin}}px;"{{?}} ><a title="{{=it.content.dataset[i].title}}" href="{{=it.content.dataset[i].link}}" ><img src="{{=it.content.dataset[i].pic}}?x-oss-process=image/resize,w_850" width="100%" /></a></li>
{{}}}
</ul>
{{??}}
{{?}}
</section>
</div>
</script>
<!--分类图标-->
<script  type="dot-template" id="type_con_3">
<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px"{{?}}>
<div class="content-box col{{= it.content.dataset.length }}">
{{ for(var i=0,l=it.content.dataset.length;i<l;i++) { }}
    <div class="icon-box"><a href="{{=it.content.dataset[i].link}}"><img src="{{=it.content.dataset[i].pic}}?x-oss-process=image/resize,w_200">{{? it.content.pro_title_show==1}}<p style="color:{{=it.content.dataset[i].color}}">{{=it.content.dataset[i].title}}</p>{{?}}</a></div>
{{ } }}
    <div class="clear"></div>
</div>
</div>
</script>
<!--橱窗二图-->
<script  type="dot-template" id="type_con_9">
<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px"{{?}}>
{{? it.content.css_type==1}}
<div class="hf-box-1">
    <a href="{{=it.content.dataset[0].link}}"><img  class="hf-img"  src="{{=it.content.dataset[0].pic}}?x-oss-process=image/resize,w_400"></a>
    <a href="{{=it.content.dataset[1].link}}"><img  class="hf-img"  src="{{=it.content.dataset[1].pic}}?x-oss-process=image/resize,w_400"></a>
    <div class="clear"></div>
</div>
{{?}}
</div>
</script>
<!--橱窗三图-->
<script  type="dot-template" id="type_con_4">
<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px"{{?}}>
{{? it.content.css_type==1}}
<div class="zt-box">
    <a  class="img1" href="{{=it.content.dataset[0].link}}" style="background-image:url({{=it.content.dataset[0].pic}}?x-oss-process=image/resize,w_400)"></a>
    <a  class="img2" href="{{=it.content.dataset[1].link}}" style="background-image:url({{=it.content.dataset[1].pic}}?x-oss-process=image/resize,w_400)"></a>
    <a  class="img3" href="{{=it.content.dataset[2].link}}" style="background-image:url({{=it.content.dataset[2].pic}}?x-oss-process=image/resize,w_400)"></a>
    <div class="clear"></div>
</div>
{{?? it.content.css_type==2}}
<div class="fl-box clearfix">
    <a href="{{=it.content.dataset[0].link}}"><img  class="f-img"  src="{{=it.content.dataset[0].pic}}?x-oss-process=image/resize,w_400"></a>
    <a href="{{=it.content.dataset[1].link}}"><img  class="f-img"  src="{{=it.content.dataset[1].pic}}?x-oss-process=image/resize,w_400"></a>
    <a href="{{=it.content.dataset[2].link}}"><img  class="f-img"  src="{{=it.content.dataset[2].pic}}?x-oss-process=image/resize,w_400"></a>
</div>
{{?}}
</div>
</script>
<!--橱窗（四图）-->
<script  type="dot-template" id="type_con_8">
<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px"{{?}}>
{{? it.content.css_type==1}}
<div class="window-box-1 clearfix">
    <a  class="img1" href="{{=it.content.dataset[0].link}}" style="background-image:url({{=it.content.dataset[0].pic}}?x-oss-process=image/resize,w_400)"></a>
    <a  class="img2" href="{{=it.content.dataset[1].link}}" style="background-image:url({{=it.content.dataset[1].pic}}?x-oss-process=image/resize,w_400)"></a>
    <a  class="img3" href="{{=it.content.dataset[2].link}}" style="background-image:url({{=it.content.dataset[2].pic}}?x-oss-process=image/resize,w_400)"></a>
    <a  class="img4" href="{{=it.content.dataset[3].link}}" style="background-image:url({{=it.content.dataset[3].pic}}?x-oss-process=image/resize,w_400)"></a>
</div>
{{?? it.content.css_type==2}}
<div class="window-box-2 clearfix">
    <a href="{{=it.content.dataset[0].link}}"><img src="{{=it.content.dataset[0].pic}}?x-oss-process=image/resize,w_200" class="img1"></a>
    <a href="{{=it.content.dataset[1].link}}"><img src="{{=it.content.dataset[1].pic}}?x-oss-process=image/resize,w_200"  class="img1"></a>
    <a href="{{=it.content.dataset[2].link}}"><img src="{{=it.content.dataset[2].pic}}?x-oss-process=image/resize,w_200"  class="img1"></a>
    <a href="{{=it.content.dataset[3].link}}"><img src="{{=it.content.dataset[3].pic}}?x-oss-process=image/resize,w_200"  class="img1"></a>
</div>
{{?}}
</div>
</script>
<!--分类产品-->
<script  type="dot-template" id="type_con_5">

<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px;background:#edeaea"{{?}}>
<div class="floor clearfix" id="goods_list">
	{{ for(var i=0,l=it.product.prodata.length;i<l;i++) { }}
    {{? it.content.css_type==1}}
    	{{? it.content.shop_type==0}}
    		<a href="../../mshop/product_detail.php?pid={{=it.product.prodata[i].pid}}&customer_id=<?php echo $customer_id_en; ?>">
    	{{?? it.content.shop_type==1}}
    		<a href="../../city_area/shop/product_detail.php?product_id={{=it.product.prodata[i].pid}}&customer_id=<?php echo $customer_id_en; ?>&order_supply_id={{=it.product.prodata[i].cityarea_id}}">
    	{{?}}
    <div class="pro-box">
    	{{? it.content.shop_type==1 && it.product.prodata[i].is_sharecard==1}}
    		<img class="shop-logo" style="position: absolute;left: 0px;top: 0px;width: 50px;height: 50px;" src="../../city_area/shop/images/sharecard_image/sharecard_icon.png">
    	{{?}}
        <img src="{{=it.product.prodata[i].default_imgurl}}?x-oss-process=image/resize,w_400" >
        {{? it.content.pro_title_show==1}}<p {{? it.content.pro_title_twoline==0}}class="goods-title"{{?? it.content.pro_title_twoline==1}}class="goods-title-2"{{?}}>{{=it.product.prodata[i].name}}</p>{{?}}
            <span class="goods-price"><span class="yen">
			<?php if(OOF_P != 2) echo OOF_S ?>
			</span>{{=it.product.prodata[i].now_price}}</span>
			<?php if(OOF_P == 2) echo OOF_S ?>
            <span class="old-price"><span class="yen">
			<?php if(OOF_P != 2) echo OOF_S ?>
			</span>{{=it.product.prodata[i].orgin_price}}</span>
			<?php if(OOF_P == 2) echo OOF_S ?>
        {{? it.content.show_sale==1}}<span class="sale">已售 {{=it.product.prodata[i].count}}</span>{{?}}
    </div>
    </a>
    {{?? it.content.css_type==2}}
    	{{? it.content.shop_type==0}}
    		<a href="../../mshop/product_detail.php?pid={{=it.product.prodata[i].pid}}&customer_id=<?php echo $customer_id_en; ?>">
    	{{?? it.content.shop_type==1}}
    		<a href="../../city_area/shop/product_detail.php?product_id={{=it.product.prodata[i].pid}}&customer_id=<?php echo $customer_id_en; ?>&order_supply_id={{=it.product.prodata[i].cityarea_id}}">
    	{{?}}
    <div class="pro-box-solo" style="margin-bottom:0px">
    	{{? it.content.shop_type==1 && it.product.prodata[i].is_sharecard==1}}
    		<img class="shop-logo" style="position: absolute;left: 0px;top: 0px;width: 50px;height: 50px;" src="../../city_area/shop/images/sharecard_image/sharecard_icon.png">
    	{{?}}
		 {{? it.product.prodata[i].storenum == 0}}
        <img style="position:absolute; z-index:0;opacity: 0.9;height:130px" src="./img/ysq1.png" >
		<img style="position::absolute; z-index:1;height:130px" src="{{=it.product.prodata[i].default_imgurl}}" >
		{{??}}
		<img style="height:130px" src="{{=it.product.prodata[i].default_imgurl}}" >
		{{?}}
        {{? it.content.pro_title_show==1}}<p {{? it.content.pro_title_twoline==0}}class="goods-title"{{?? it.content.pro_title_twoline==1}}class="goods-title-2" style="font-size:14px;height:20px" {{?}}>{{=it.product.prodata[i].name}}</p>{{?}}
		</a>
		<div class="biv">
		<div class="leats">
        <p class="price-box">
            <span class="goods-price-solo" style="font-size:18px"><span class="yen" style="font-size:18px">
			<?php if(OOF_P != 2) echo OOF_S ?>
			</span >{{=it.product.prodata[i].now_price}}</span>
			<?php if(OOF_P == 2) echo OOF_S ?>
            <span class="old-price-solo"><span class="yen">
			<?php if(OOF_P != 2) echo OOF_S ?>
			</span>{{=it.product.prodata[i].orgin_price}}</span>

        </p>
		<p class="yiso">
        {{? it.content.show_sale==1}}<span class="sale-solo">  <i>{{=it.product.prodata[i].count}}</i>份/{{?}}
					<?php if(OOF_P == 2) echo OOF_S ?>
			<!--还剩：<i>{{=it.product.prodata[i].now_count}}</i>份</span>-->
			还剩：<i>{{=it.product.prodata[i].storenum}}</i>份</span>
        </p>
       </div>


<div class="gouwuches">	
<div class="lijigoumaiann" data-id="{{=it.product.prodata[i].pid}}" id="lijigoumaiann_{{=it.product.prodata[i].pid}}">

<div class="goumaicontainer toBuyContainer" id="goumaicontainer_{{=it.product.prodata[i].pid}}">
{{? it.product.prodata[i].base_buystart_time < <?php echo time();?>}}

	 {{? it.product.prodata[i].storenum == 0}}
	<div class="goumaianniu" id="goumaianniu_{{=it.product.prodata[i].pid}}" onclick="" style="display:block;background:#666666">产品售罄</div>
	 {{??}}
	 <div class="goumaianniu" id="goumaianniu_{{=it.product.prodata[i].pid}}" onclick="buyClick({{=it.product.prodata[i].pid}})" style="display:block;">加入购物车</div>
	  {{?}}
	  
 {{?}} 
 
 {{? it.product.prodata[i].base_buystart_time > <?php echo time();?>}}

	 {{? it.product.prodata[i].storenum == 0}}
	<div class="goumaianniu" id="goumaianniu_{{=it.product.prodata[i].pid}}" onclick="" style="display:block;background:#666666">产品售罄</div>
	 {{??}}
	 <div class="goumaianniu" id="goumaianniu_{{=it.product.prodata[i].pid}}" onclick="" style="display:block;background:#666666">未开售</div>
	  {{?}}
	  
 {{?}} 
 
<input type="hidden" id="is_supply_id_{{=it.product.prodata[i].pid}}" value="{{=it.product.prodata[i].is_supply_id}}">
<input type="hidden" id="storenum_{{=it.product.prodata[i].pid}}" value="{{=it.product.prodata[i].storenum}}">
	<input type="hidden" id="is_QR_{{=it.product.prodata[i].pid}}" value="{{=it.product.prodata[i].is_QR}}">
	<input type="hidden" id="is_identity_{{=it.product.prodata[i].pid}}" value="{{=it.product.prodata[i].is_identity}}">
	<input type="hidden" id="is_virtual_{{=it.product.prodata[i].pid}}" value="{{=it.product.prodata[i].is_virtual}}">
	<input type="hidden" id="pro_card_level_id_{{=it.product.prodata[i].pid}}" value="{{=it.product.prodata[i].pro_card_level_id}}">
<div class="goumaianniujiajian" id="goumaianniujiajian_{{=it.product.prodata[i].pid}}" style="display:none;">
	<div onclick="subCountClick({{=it.product.prodata[i].pid}})" class="anniujianhao  " style=";">－</div>
	<div class="anniushuzi"  id="anniushuzi_{{=it.product.prodata[i].pid}}">0</div>
	<div onclick="addCountClick({{=it.product.prodata[i].pid}})" class="anniujiahao ">＋</div>
</div>

</div>
</div>
</div>
</div>
	{{?it.product.prodata[i].buystart_time != 0}}
    <div class="">预售：	
		<a style="color:red">{{=it.product.prodata[i].buystart_time}}至：{{=it.product.prodata[i].countdown_time}}</a>
	
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		{{?}}
		提货时间：<a style="color:red">{{=it.product.prodata[i].tihuo_time}}</a>
	</div>

    </div>
<div class="navdl"></div>
    {{??}}
{{?}}
	{{ } }}

</div>
</div>
</script>
 <!--底部菜单-->
<script  type="dot-template" id="type_con_6">
<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px"{{?}}>
    <div class="{{? it.content.foot_position==2}}foot-box{{?? it.content.foot_position==1}}foot-box-fix{{??}}{{?}} col{{= it.content.dataset.length }} clearfix" style="{{? it.content.padding}}padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px;{{?}} background-color:{{=it.content.bg_color}} ">
    {{ for(var i=0,l=it.content.dataset.length;i<l;i++) { }}
        <div class="icon-box">
            <a href="{{=it.content.dataset[i].link}}"><img src="{{=it.content.dataset[i].pic}}?x-oss-process=image/resize,w_200" {{? it.content.pro_title_show==0}} class="big-img"{{?}}>{{? it.content.dataset[i].title=="购物车"}}<span id="cart_num"></span>{{?}}{{? it.content.pro_title_show==1}}<p style="color:{{=it.content.dataset[i].color}}">{{=it.content.dataset[i].title}}</p>{{?}}</a>
        </div>
    {{ } }}
    </div>
    {{? it.content.foot_position==1}}
    <div class="clear-fix"></div>
    {{?}}
</div>
</script>
 <!--底部菜单 End -->
<!--分割线-->
<script type="text/j-template" id="type_con_7">
<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px"{{?}}>
    <div class="members_con">
        <a title="{{=it.content.dataset[0].title}}" href="{{=it.content.dataset[0].link}}" ><img src="{{=it.content.dataset[0].pic}}?x-oss-process=image/resize,w_850" width="100%" /></a>
    </div>
</div>
</script>
<!--视频-->
<script type="dot-template" id="type_con_10">
<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px"{{?}}>
    {{?it.content.video_link}}<iframe class="diy-video" src="{{=it.content.video_link}}" width="100%" height="220" wmode="transparen" allowfullscreen="true" style="border:0;"></iframe>
    {{??}}<img src="<?php echo $new_baseurl;?>/weixinpl/common_shop/common/custom_temp/images/video.jpg" style="width:100%">
    {{?}}
</div>
</script>
<!--LBS定位-->
<?php
    include_once($_SERVER['DOCUMENT_ROOT'].'/mp/geolocation.php');
	//自定义模板有定位，当是h5小程序跳转过来，引入定位文件
    if(isset($_SESSION["from_type_mini_".$customer_id])){
        if(!empty($customarr)){
            $is_diy_location = 0;
            foreach($customarr as $k=>$v){ //当存在lbs定位或者线下店铺时，需要定位
                if((int)$v['type'] == 11 || (int)$v['type'] == 16){
                    $is_diy_location = 1;
                }
            }
        }
    
       $from_type_mini = (int)$_SESSION["from_type_mini_".$customer_id];

       if($from_type_mini == 5 && $is_diy_location == 1){
         require_once($_SERVER['DOCUMENT_ROOT'].'/mp/geolocation.php');
       }  
    }
    
    $map_key = 'qN0AxhOsIsx0rQmdwkZGE9Cr';//百度地图key
	$qq_map_key = 'KVLBZ-LJUKF-LGQJZ-J2IGO-FGNF5-XCBJH';//腾讯地图key
	require_once('lbs_function.php');
	$city_name = "";
	$city_name_auto = "";

	if( !empty($_GET["Cname"]) ){    //城市名
		$city_name 				= $configutil->splash_new($_GET["Cname"]);
		$city_name_auto 		= $city_name;
		$_SESSION['city_name'] 	= $city_name;
	}else if( !empty($_SESSION['city_name'] )){
		$city_name 		= $_SESSION['city_name'];
		$city_name_auto = $_SESSION['city_name'];
	}

	$province_name = '';
	if( !empty($_GET["Pname"]) ){		//省份
		$province_name 				= $configutil->splash_new($_GET["Pname"]);
		$_SESSION['province_name'] 	= $province_name;
	}else if( !empty($_SESSION['province_name'] )){
		$province_name = $_SESSION['province_name'];
	}

	$area_name = '';				//当前位置
	if( !empty($_GET["Aname"]) ){
		$area_name 				= $configutil->splash_new($_GET["Aname"]);
		$_SESSION['area_name'] 	= $area_name;
	}else if( !empty($_SESSION['area_name']) ){
		$area_name = $_SESSION['area_name'];
	}

	//经纬度
	if( !empty($_GET["latitude"]) ){
		$latitude 				= $configutil->splash_new($_GET["latitude"]);
		$_SESSION['latitude'] 	= $latitude;
	}
	if( !empty($_GET["longitude"]) ){
		$longitude 				= $configutil->splash_new($_GET["longitude"]);
		$_SESSION['longitude'] 	= $longitude;
	}
	//根据经纬度获取地理位置
	if( !empty($_SESSION['latitude']) && !empty($_SESSION['longitude']) ){
		$area_name = getAddress_diytemplate($_SESSION['latitude'],$_SESSION['longitude'],$qq_map_key);
		$_SESSION['area_name'] = $area_name;
	}
	/*if(empty($_SESSION['city_name'])){
		$res = GetAddress_IP_diytemplate();
		$city_name = $res['city'];
		if($city_name==''){
			$city_name = getAddress($res['lat'],$res['lng'],$qq_map_key,1);
		}
		$_SESSION['city_name'] = $city_name;
	}else{
		$city_name = $_SESSION['city_name'];
		$city_name_auto = $_SESSION['city_name'];
	}*/
	// $_SESSION['city_name'] = '';

	$replace_str = array('市'=>'','地区'=>'','自治州'=>'');


?>
<script  type="dot-template" id="type_con_11">
<div class="con_display" style="{{? it.content.bg_color}}background-color:{{= it.content.bg_color}};{{?}}{{? it.content.dataset[0].pic}}background-image:url({{=it.content.dataset[0].pic}});background-size:100%;background-repeat:no-repeat;{{?}}{{? it.content.padding}}padding:{{= it.content.padding}}px 0;{{?}}">
    <div class="type1" >
        <div id="topDiv" class="topDiv" >
            <div class="searchArea" style="height:50px;line-height:50px;">
				{{? it.content.css_type==1}}
                <div class="selectArea" class="leftPane disp-inblock" style="overflow: hidden;padding-left:5px;">
                    <img style="float:left;margin-top:15px;" class="arrow" src="<?php echo $new_baseurl;?>/weixinpl/common_shop/common/custom_temp/images/lbs.png">
                    <span style="font-size:15px;float:left;padding-left:5px;color:{{= it.content.color}};" class="title" id="city_name" onclick="citynav()"><?php echo strtr($city_name,$replace_str);?></span>
					<img src="<?php echo $new_baseurl;?>/weixinpl/common_shop/common/custom_temp/images/xiala.png" style="display: inline-block;margin: 21px 5px;" onclick="citynav()">
				</div>
				{{?? it.content.css_type==2}}
					<div class="lbs_search2">
						<div class="f_box first" onclick="citynav()">
							<p class="f_box" style="color:{{= it.content.color}};font-size:15px;" id="city_name"><?php echo strtr($city_name,$replace_str);?></p>
							<img class="f_box" src="<?php echo $new_baseurl;?>/weixinpl/common_shop/common/custom_temp/images/xiala.png">
						</div>
						<div class="f_box second" style="width:72%">
							<span onclick="lbs_search_name()"></span>
							<input type="text" placeholder="{{= it.content.placeholder}}" id="lbs_searchname" name="lbs_searchname" value="" onkeydown="if(event.keyCode==13){lbs_search_name();}" >
						</div>
					</div>
				{{?? it.content.css_type==3}}
					<div class="lbs_search3">
                        <div class="f_box first" style="width:20%;max-width:55px;" onclick="citynav()">
							<p class="f_box" style="color:{{= it.content.color}};font-size:15px;" id="city_name"><?php echo strtr($city_name,$replace_str);?></p>
							<img class="f_box" src="<?php echo $new_baseurl;?>/weixinpl/common_shop/common/custom_temp/images/xiala.png">
                        </div>
						<div class="f_box second" style="margin-top:0;width:68%;margin-left:2%;">
							<input type="text" placeholder="{{= it.content.placeholder}}" id="lbs_searchname" name="lbs_searchname" value="" onkeydown="if(event.keyCode==13){lbs_search_name();}">
						</div>
						<div class="f_box third" style="float:right;margin-right:2%;margin-left:0;width:7%;" >
							<span onclick="lbs_search_name()"></span>
						</div>
					</div>
				{{?}}
                <div class="clear"></div>
            </div>
        </div>
    </div>
    <div class="type2" style="display:none;position:absolute;z-index:999;width:100%;">
            <div id="areaContainerDiv" class="dataDiv">
            <div class="entry-content">
                <ul id="areaList" class="areaList" style="background-color:#fff;">
                    <li class="itemWrapper">
                        <div class="area-info" area-id="1">
                            <span>北京市</span>
                            <img class="arrow" src="./images/arrow_right_gray2.png" >
                        </div>
                        <div class="clear"></div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>
</script>
<!--LBS城市广告-->
<script  type="dot-template" id="type_con_12">
{{? it.content.is_show}}
<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px"{{?}}>

{{? it.content.css_type==1}}
	{{
		var pic_len = it.content.dataset.length;
	}}
<div id="banner_tabs" class="flexslider">
	{{? pic_len > 1 }}
    <ul class="slides">
    {{ for(var i=0,l=it.content.dataset.length;i<l;i++) { }}
		{{? it.content.dataset[i].is_show}}
        <li><a title="{{=it.content.dataset[i].title}}" href="{{=it.content.dataset[i].link}}" ><img src="{{=it.content.dataset[i].pic}}?x-oss-process=image/resize,w_850" width="100%" /></a></li>
		{{?}}
    {{}}}
    </ul>
    <ul class="flex-direction-nav" style="display:none;">
        <li><a class="flex-prev" id="btn_prev" href="javascript:;"></a></li>
        <li><a class="flex-next" id="btn_next" href="javascript:;"></a></li>
    </ul>
    <ol class="flicking_con">
    {{ for(var i=0,l=it.content.dataset.length;i<l;i++) { }}
		{{? it.content.dataset[i].is_show}}
        <li><a {{? i==0}} class="on" {{?}}>{{=i+1}}</a></li>
		{{?}}
    {{ } }}
    </ol>
	{{??}}
	<ul class="one_pic">
		{{? it.content.dataset[0].is_show}}
        <li><a title="{{=it.content.dataset[0].title}}" href="{{=it.content.dataset[0].link}}" ><img src="{{=it.content.dataset[0].pic}}?x-oss-process=image/resize,w_850" width="100%" /></a></li>
		{{?}}
	</ul>
	{{?}}
</div>
{{?? it.content.css_type==2}}
<section class="members_imgad">
<ul class="img-box clearfix">
	{{ for(var i=0,l=it.content.dataset.length;i<l;i++) { }}
		{{? it.content.dataset[i].is_show}}
		<li {{? it.content.margin}} style="margin-bottom:{{= it.content.margin}}px;"{{?}} ><a title="{{=it.content.dataset[i].title}}" href="{{=it.content.dataset[i].link}}" ><img src="{{=it.content.dataset[i].pic}}?x-oss-process=image/resize,w_850" width="100%" /></a></li>
		{{?}}
	{{}}}
</ul>
{{?}}
</section>
</div>
{{?}}
</script>
<!--滚动公告栏-->
<script type="text/j-template" id="type_con_13">
{{? it.content.rolling_direction==1}}
	{{
		$(function(){
			$('#marquee{{= it.id}}').kxbdSuperMarquee({
				isMarquee:true,
				direction:'left',
				isEqual:false,
				scrollDelay:it.content.rolling_speed
			});
		});
	}}
{{?? it.content.rolling_direction==2}}
	{{
		$(function(){
			$('#marquee{{= it.id}}').kxbdSuperMarquee({
				direction:'up',
				isEqual:false,
				distance:40,
				time:it.content.show_time_limit
			});
		});
	}}
{{?}}
{{

     var wH=parseInt($(window).width());

}}
<div class="con_display" {{? it.content.padding}}style="padding:{{= it.content.padding}}px 0;"{{?}}>
{{? it.content.css_type==1}}
<!--<div style="height:40px;line-height:40px;background-color:#fef7ee;border:1px solid #ffcc74;padding-left:34px;background-image:url(<?php echo $new_baseurl;?>/weixinpl/common_shop/common/custom_temp/images/laba01.png);background-repeat:no-repeat;background-position:10px 9px;background-size:20px 20px">
	<div id="marquee{{= it.id}}" class="marquee">
		<ul>
		{{for (var j=0,k=it.content.dataset.length;j<k;j++) { }}
			<li style="{{? it.content.rolling_direction==1}}display:inline-block;width:{{= it.content.dataset[j].title.length*16+wH-34}}px;{{?}}color:#ffaf74;"><a href="{{= it.content.dataset[j].link}}" style="color:#ffaf74;font-size:16px;">{{= it.content.dataset[j].title}}</a></li>
		{{ } }}
		</ul>
	</div>
</div>-->
<?php 

	$menu_url = Protocol.$http_host."/weixinpl/common_shop/jiushop/index.php?customer_id=".$customer_id_en;
	$category_id = !$_GET['category_id']?46:$configutil->splash_new($_GET["category_id"]);

?>
<style>
#menu {height:30px;background-color:white;}
#menu ul {list-style:none;margin:0px;text-align: center;margin:0;padding-top:14px} 
#menu ul li {float:left;width:14%}
#menu ul li a{font-size:16px}
#menu ul li.yyyzzz{border-bottom:2px solid #66CCFF}
</style>
<div id="menu"> 
<ul> 
	<li class="<?php if($category_id == 46){echo "yyyzzz";} ?>"><a href="<?php echo $menu_url.'&category_id=46'?>">热卖</a></li> 
	<li class="menuDiv"></li> 
	<li class="<?php if($category_id == 38){echo "yyyzzz";} ?>"><a href="<?php echo $menu_url.'&category_id=38'?>">水果</a></li> 
	<li class="menuDiv"></li> 
	<li class="<?php if($category_id == 39){echo "yyyzzz";} ?>"><a href="<?php echo $menu_url.'&category_id=39'?>">蔬菜</a></li> 
	<li class="menuDiv"></li> 
	<li class="<?php if($category_id == 40){echo "yyyzzz";} ?>"><a href="<?php echo $menu_url.'&category_id=40'?>">生鲜</a></li> 
	<li class="menuDiv"></li> 
	<li class="<?php if($category_id == 41){echo "yyyzzz";} ?>"><a href="<?php echo $menu_url.'&category_id=41'?>">粮油</a></li> 
	<li class="menuDiv"></li> 
	<li class="<?php if($category_id == 42){echo "yyyzzz";} ?>"><a href="<?php echo $menu_url.'&category_id=42'?>">百货</a></li> 
	<li class="menuDiv"></li> 
	<li class="<?php if($category_id == 47){echo "yyyzzz";} ?>"><a href="<?php echo $menu_url.'&category_id=47'?>">煮熟</a></li> 
</ul> 
</div>
{{?? it.content.css_type==2}}
<div style="height:40px;line-height:40px;background-color:#ffebed;border:1px solid #f7929c;padding-left:34px;background-image:url(<?php echo $new_baseurl;?>/weixinpl/common_shop/common/custom_temp/images/laba02.png);background-repeat:no-repeat;background-position:10px 9px;background-size:20px 20px">
	<div id="marquee{{= it.id}}" class="marquee">
		<ul>
		{{for (var j=0,k=it.content.dataset.length;j<k;j++) { }}
			<li style="{{? it.content.rolling_direction==1}}display:inline-block;width:{{= it.content.dataset[j].title.length*16+wH-34}}px;{{?}}color:#db8089;"><a href="{{= it.content.dataset[j].link}}" style="color:#db8089;font-size:16px;">{{= it.content.dataset[j].title}}</a></li>
		{{ } }}
		</ul>
	</div>
</div>
{{?? it.content.css_type==3}}
<div style="height:40px;line-height:40px;background-color:#f6fee7;border:1px solid #b4e14d;padding-left:34px;background-image:url(<?php echo $new_baseurl;?>/weixinpl/common_shop/common/custom_temp/images/laba03.png);background-repeat:no-repeat;background-position:10px 9px;background-size:20px 20px">
	<div id="marquee{{= it.id}}" class="marquee">
		<ul>
		{{for (var j=0,k=it.content.dataset.length;j<k;j++) { }}
			<li style="{{? it.content.rolling_direction==1}}display:inline-block;width:{{= it.content.dataset[j].title.length*16+wH-34}}px;{{?}}color:#aec181;"><a href="{{= it.content.dataset[j].link}}" style="color:#aec181;font-size:16px;">{{= it.content.dataset[j].title}}</a></li>
		{{ } }}
		</ul>
	</div>
</div>
{{?? it.content.css_type==4}}
<div style="height:40px;line-height:40px;background-color:#dff9ff;border:1px solid #78c3d4;padding-left:34px;background-image:url(<?php echo $new_baseurl;?>/weixinpl/common_shop/common/custom_temp/images/laba04.png);background-repeat:no-repeat;background-position:10px 9px;background-size:20px 20px">
	<div id="marquee{{= it.id}}" class="marquee">
		<ul>
		{{for (var j=0,k=it.content.dataset.length;j<k;j++) { }}
			<li style="{{? it.content.rolling_direction==1}}display:inline-block;width:{{= it.content.dataset[j].title.length*16+wH-34}}px;{{?}}color:#8ac4d1;"><a href="{{= it.content.dataset[j].link}}" style="color:#8ac4d1;font-size:16px;">{{= it.content.dataset[j].title}}</a></li>
		{{ } }}
		</ul>
	</div>
</div>
{{?? it.content.css_type==5}}
<div style="height:40px;line-height:40px;background-color:#fcecff;border:1px solid #efabff;padding-left:34px;background-image:url(<?php echo $new_baseurl;?>/weixinpl/common_shop/common/custom_temp/images/laba05.png);background-repeat:no-repeat;background-position:10px 9px;background-size:20px 20px">
	<div id="marquee{{= it.id}}" class="marquee">
		<ul>
		{{for (var j=0,k=it.content.dataset.length;j<k;j++) { }}
			<li style="{{? it.content.rolling_direction==1}}display:inline-block;width:{{= it.content.dataset[j].title.length*16+wH-34}}px;{{?}}color:#d69be4;"><a href="{{= it.content.dataset[j].link}}" style="color:#d69be4;font-size:16px;">{{= it.content.dataset[j].title}}</a></li>
		{{ } }}
		</ul>
	</div>
</div>
{{?}}
</div>
</script>
<!--头部引导页-->
<?php
$exp_user_id = -1;
if(!empty($_GET['exp_user_id'])){
	$exp_user_id = $configutil->splash_new($_GET["exp_user_id"]);
	$exp_user_id = passport_decrypt($exp_user_id);
}
$weixin_name 	   = '';
$weixin_headimgurl = '';
$query_user = "select weixin_name,weixin_headimgurl from weixin_users where isvalid=true and customer_id=".$customer_id;
$contact_user_id = -1;	//查询联系人的user_id
if($exp_user_id > 0){
	$query_user .= " and id=".$exp_user_id;	//分享链接
	$contact_user_id = $exp_user_id;
}else{
	$query_user .= " and id=".$user_id;
	$contact_user_id = $user_id;
}
$result_user = _mysql_query($query_user) or die('Query_user failed:'.mysql_error());
while($row_user = mysql_fetch_object($result_user)){
	$weixin_name 	   = $row_user->weixin_name;
	$weixin_headimgurl = $row_user->weixin_headimgurl;
}
if(empty($weixin_headimgurl)){
	$weixin_headimgurl = '../common/custom_temp/images/username.png';
}else{
	$pos = strpos($weixin_headimgurl,"//");

	if($pos===0){

	}else{
		$pos1 = strpos($weixin_headimgurl,"../../../");
		$pos2 = strpos($weixin_headimgurl,"../../");
		$pos3 = strpos($weixin_headimgurl,"../");
		if($pos1===0){
			$weixin_headimgurl = substr($weixin_headimgurl,9);
		}elseif($pos2===0){
			$weixin_headimgurl = substr($weixin_headimgurl,6);
		}elseif($pos3===0){
			$weixin_headimgurl = substr($weixin_headimgurl,3);
		}
		$weixin_headimgurl = BaseURL.$weixin_headimgurl;
	}
}
/* 是否关注公众号 */
/*$oauth = $_GET['oauth'];
$code = $_GET['code'];
if($oauth==0 && $from_type == 1 && empty($_SESSION['subscribe'])){
	$r_url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".$appid."&redirect_uri=";
	$d_url="//".$http_host."/weixinpl/weixin_inter/oauth_headguide.php?customer_id=".$customer_id;
	if( $exp_user_id > 0 ){
		$d_url .= "&exp_user_id=".$exp_user_id;
	}

	$d_url = urlencode($d_url);
	$r_url = $r_url.$d_url;
	$r_url = $r_url."&response_type=code&scope=snsapi_base&state=wsy#wechat_redirect";
	echo "<script>document.location='".$r_url."';</script>";
	return;
}*/
$subscribe = 0;
if( !empty($_SESSION['subscribe_'.$customer_id]) ){
	$subscribe = $_SESSION['subscribe_'.$customer_id];	//是否关注公众号,0：否，1：是
}

/* 是否关注公众号 */

$suffix 		= '';	//后缀
$introduce 		= '';	//介绍
$backgroung_img = '';	//背景图
$query_info = "select suffix,introduce,backgroung_img from weixin_commonshop_user_contact_info where isvalid=true and customer_id=".$customer_id." and user_id=".$contact_user_id;
$result_info = _mysql_query($query_info) or die('Query_info failed:'.mysql_error());
while($row_info = mysql_fetch_object($result_info)){
	$suffix 		= $row_info->suffix;
	$introduce 		= $row_info->introduce;
	$backgroung_img = $row_info->backgroung_img;
}
if(empty($backgroung_img)){	//背景图为空则默认橙色背景图
	$backgroung_img = '../common/custom_temp/images/headguide_bg.png';
}

/* 查询联系人 start*/
$weixin_contact_num = 0;	//微信联系人个数
$qq_contact_num 	= 0;	//QQ联系人个数
$phone_contact_num 	= 0;	//电话联系人个数

$query_weixin = "select id,name,contact_information from weixin_commonshop_user_contacts where isvalid=true and customer_id=".$customer_id." and user_id=".$contact_user_id." and type=2";
$result_weixin = _mysql_query($query_weixin) or die('Query_weixin failed:'.mysql_error());
$weixin_contact_num = mysql_num_rows($result_weixin);

$query_qq = "select id,name,contact_information from weixin_commonshop_user_contacts where isvalid=true and customer_id=".$customer_id." and user_id=".$contact_user_id." and type=1";
$result_qq = _mysql_query($query_qq) or die('Query_qq failed:'.mysql_error());
$qq_contact_num = mysql_num_rows($result_qq);

$query_phone = "select id,name,contact_information from weixin_commonshop_user_contacts where isvalid=true and customer_id=".$customer_id." and user_id=".$contact_user_id." and type=3";
$result_phone = _mysql_query($query_phone) or die('Query_phone failed:'.mysql_error());
$phone_contact_num = mysql_num_rows($result_phone);
/* 查询联系人 end*/

/*公众号二维码*/
$qr_foreign_id = -1;
$query_qr = "select id from weixin_baseinfos where isvalid=true and customer_id=".$customer_id;
$result_qr = _mysql_query($query_qr) or die("Query_qr failed:".mysql_error());
while($row_qr = mysql_fetch_object($result_qr)){
	$qr_foreign_id = $row_qr->id;
}
$qr_imgurl = '';
$query_qr_img = "select imgurl from images where isvalid=true and foreign_id=".$qr_foreign_id." and type=3";
$result_qr_img = _mysql_query($query_qr_img) or die('Query_qr_img failed:'.mysql_error());
while($row_qr_img = mysql_fetch_object($result_qr_img)){
	$qr_imgurl = $row_qr_img->imgurl;
}
$qr_imgurl = Protocol.$http_host.HostPort.'/WeixinManager/qrsbig/'.$qr_imgurl;

/*公众号二维码*/
?>
<script type="text/j-template" id="type_con_14">
<div class="con_display" {{? it.content.padding}}style="padding:{{= it.content.padding}}px 0;"{{?}}>
	<nav class="headguide_nav" style="background-image:url(<?php echo $backgroung_img;?>);">
		<div class="navright">
		<?php
			if( $subscribe ){
		?>
			<div class="checkbg"><img id="gougou" src="../common/custom_temp/images/gougou.png"><span>已关注</span></div>
		<?php
			}else{
		?>
		<div class="checkbg" onclick="subscribe()">+关注</div>
		<?php
			}
		?>
		<?php
			if($exp_user_id == $user_id || $exp_user_id < 0){
		?>
		<img src="../common/custom_temp/images/edit_banner.png" onclick="headguide_edit()">
		<?php
			}
		?>
		</div>
		<?php //获取头像
			$query3="select weixin_headimgurl from weixin_users where isvalid=true and customer_id=".$customer_id ." and weixin_fromuser='".$fromuser."' order by id desc limit 0,1";
			$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
			while ($row = mysql_fetch_object($result3))
			{
				$wx_headimgurl = $row->weixin_headimgurl;
			}
		?>
		<div class="navportrait">
			<div class="headportrait">
				<div class="navimg">
					<img src="<?php echo $wx_headimgurl;?>" alt="">
				</div>
			</div>
			<div class="navdescribe">
				<span style="color: #ffffff;"><?php echo $weixin_name;?></span>
				<div class="navtag" style="color: #ffffff;"><?php echo $suffix;?></div>
				<p class="navintroduce" style="color: #ffffff;"><?php echo $introduce;?></p>
			</div>
		</div>
		<div class="bian"></div>
		<div class="contacttypediv">
			<div class="qtypebtu" onclick="show_contact(1)">
				<img src="../common/custom_temp/images/qqw.png" alt=""><span>QQ</span>
			</div>
			<div class="wtypebtu" onclick="show_contact(2)">
				<img src="../common/custom_temp/images/weixinw.png" alt=""><span>微信</span>
			</div>
			<div class="ptypebtu" onclick="show_contact(3)">
				<img src="../common/custom_temp/images/dianhuaw.png" alt=""><span>电话</span>
			</div>
		</div>
	</nav>
	<div class="showcontent" id="qqshowdetil">
		<ul style="width: 240px;margin: 0 auto;">
		<?php
			$qq_num = 1;
			$class_color = '';
			while($row_qq = mysql_fetch_object($result_qq)){
				$qq_contact_name 		= $row_qq->name;
				$qq_contact_information = $row_qq->contact_information;
				if($qq_num == 1){
					$class_color = 'colorboxone';
				}else if($qq_num == 2){
					$class_color = 'colorboxtwo';
				}else if($qq_num == 3){
					$class_color = 'colorboxthree';
				}
		?>
			<li>
				<div class="<?php echo $class_color;?>"></div>
				<div class="showcontentleft">
					<span><?php echo $qq_contact_name;?></span>
				</div>
				<div class="showcontentright">
					<p class="pptext"><?php echo $qq_contact_information;?></p>
				</div>
			</li>
		<?php
			$qq_num++;
			}
		?>
		</ul>
	</div>
	<div class="showcontent" id="weixinshowdetil">
		<ul style="width: 240px;margin: 0 auto;">
		<?php
			$weixin_num = 1;
			$class_color = '';
			while($row_weixin = mysql_fetch_object($result_weixin)){
				$weixin_contact_name 		= $row_weixin->name;
				$weixin_contact_information = $row_weixin->contact_information;
				if($weixin_num == 1){
					$class_color = 'colorboxone';
				}else if($weixin_num == 2){
					$class_color = 'colorboxtwo';
				}else if($weixin_num == 3){
					$class_color = 'colorboxthree';
				}
		?>
			<li>
				<div class="<?php echo $class_color;?>"></div>
				<div class="showcontentleft">
					<span><?php echo $weixin_contact_name;?></span>
				</div>
				<div class="showcontentright">
					<p class="pptext"><?php echo $weixin_contact_information;?></p>
				</div>
			</li>
		<?php
			$weixin_num++;
			}
		?>
		</ul>
	</div>
	<div class="showcontent" id="phoneshowdetil">
		<ul style="width:240px;margin:0 auto;">
		<?php
			$contact_num = 1;
			while($row_phone = mysql_fetch_object($result_phone)){
				$phone_contact_name 	   = $row_phone->name;
				$phone_contact_information = $row_phone->contact_information;
		?>
			<li class="hasborder">
				<div class="showcontentleft">
					<span class="black"><?php echo $phone_contact_information;?></span>
					<span><?php echo $phone_contact_name;?></span>
				</div>
				<div class="showcontentright">
					<a href="tel:<?php echo $phone_contact_information;?>" ><img src="../common/custom_temp/images/photo1.png" style="opacity: 1;"></a>
					<a href="sms:<?php echo $phone_contact_information;?>" ><img src="../common/custom_temp/images/weixin1.png" style="margin-left: 10px;opacity: 1;"></a>
				</div>
			</li>
			<div class="bian" style="<?php if($contact_num < $phone_contact_num ){?>height:1px;<?php }else{?>height:0;<?php }?>"></div>
		<?php
			$contact_num++;
			}
		?>
		</ul>
	</div>
</div>
</script>
        <?php //获取头像
		
			$query3="select weixin_headimgurl from weixin_users where isvalid=true and customer_id=".$customer_id ." and weixin_fromuser='".$fromuser."' order by id desc limit 0,1";
			$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
			while ($row = mysql_fetch_object($result3))
				{
					$headimgurl = $row->weixin_headimgurl;
				}
		?>
<!-- 头像插件 -->
<script  type="dot-template" id="type_con_15">
    <div id='con_15' style='height:42px;display:none'></div>
    <div class="con_display" style="{{? it.content.padding}}padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px;{{?}}">
        <div class="search-box-1" style='background-color:{{= it.content.bg_color}}'>

            <div class="search-layer-1" style='height:50px;border:none;width: 100%;'>
                <div style='box-shadow: 0px 1px 1px #F7F7F7;width:100%;height:100%;background-color:{{= it.content.bg_color}};'>
                    <div style='width:50px;height:50px;position:absolute;left:17px;filter:alpha(Opacity=30);-moz-opacity:0.3;opacity: 0.3;background-color: #ECE7E7;{{? it.content.pro_title_show==1 }} border-radius: 50%;{{??}}border-radius: 5px;{{?}}'>
                    </div>
                        <img src="<?php echo $headimgurl?>" style='width:50px;height:50px;position:absolute;left:20px;{{? it.content.pro_title_show==1 }} border-radius: 50%;{{??}}border-radius: 5px;{{?}}' alt=""  class='br'>
                    <div style='width:240px;margin-left:10px;display:inline-block;position: absolute;left: 100px;color:{{= it.content.color}};top:17.5px;font-size:13px;class='search-input'>门店地址:<?php echo $data_uid_address['detail_address']?></div>
                </div>
            </div>
        </div>
    </div>
</script>
<!--线下店铺-->
<script type="dot-template" id="type_con_16">
<div class="con_display" {{? it.content.padding}}style="padding-top:{{= it.content.padding}}px;padding-bottom:{{= it.content.padding}}px;background:#f8f8f8 !important;"{{?}}>
<div class="floor clearfix" style="background:#f8f8f8;">
	{{ for(var i=0,l=it.shoplist.shopdata.length;i<l;i++) { }}
		<div class="shop-content">
          	<div class="shop-url"  shop-id="{{=it.shoplist.shopdata[i].shop_id}}">
				<img src="{{=it.shoplist.shopdata[i].logo}}" />
	                {{? it.shoplist.shopdata[i].label_image!='' && it.shoplist.shopdata[i].label_image!=null }}
						      <img class="shop-logo radius3 small" src=" {{= it.shoplist.shopdata[i].label_image }}">
	                     {{? }}
	                {{? it.shoplist.shopdata[i].is_sharecard == 1 }}
	                         <img class="shop-logo radius3" style="position: absolute;left: 10px;top:10px;width: 45px;height: 45px;" src="../../city_area/shop/images/sharecard_image/sharecard_icon.png">
	                    {{? }}

				<div class="shop-info">
					<p class="shop-name">{{=it.shoplist.shopdata[i].shop_name}}</p>
					<div class="star-grade">
						<div class="star">
								<div class="select" style="width:{{=it.shoplist.shopdata[i].evaluationAvg*20}}%;">
									<div class="star2"></div>
								</div>
							</div>
						<span class="pf">{{=it.shoplist.shopdata[i].evaluationAvg}}分</span>
					</div>
	                        {{? it.shoplist.shopdata[i].label_image2!='' && it.shoplist.shopdata[i].label_image2!=null }}
	                           <img src="{{=it.shoplist.shopdata[i].label_image2}}" class="span-img">
	                        {{? }}
					<p class="p3">
						<span class="condition01">
						<?php if(OOF_P != 2) echo OOF_S ?>
						{{=it.shoplist.shopdata[i].starting_fee}}
						<?php if(OOF_P == 2) echo OOF_S ?>
						起配送</span>
						{{? it.content.show_sale == 1}}
							<span class="condition02">已售{{=it.shoplist.shopdata[i].sell_count}}</span>
						{{? }}
						<span class="condition03">{{=it.shoplist.shopdata[i].distance}}</span>
					</p>
				</div>
			</div>
            {{? it.shoplist.shopdata[i].pay_admin == 1 && it.shoplist.shopdata[i].pay_owner == 1 }}
                <div class="line"></div>
	                <div class="shop-action" shop-id="{{=it.shoplist.shopdata[i].shop_id}}">
	                    <div style="display:none;">
	                        <div class="icon"><span class="tuan">团</span></div>
	                        <div class="content line-end-point">欢唱套餐！节假日通用！</div>
	                </div>
                    <div class="clear"></div>
                    <div>
                        <div class="icon"><span class="daodianfu">到店付</span></div>
                        <div class="open-shop content line-end-point" shop-id="{{=it.shoplist.shopdata[i].shop_id}}"></div>
                        <div class="arrow"></div>
                    </div>
          		</div>
            {{? }}
		</div>

    {{ } }}

</script>

<!--线下商铺js-->
<script>
 $(function(){
		var imgWidth = $('.shop-content img').width();
		var pHeight = (imgWidth-5)/3;
		$('.shop-content img').css('height',imgWidth+'px');
		$('.shop-info p ,.star-grade').css('height',pHeight+'px');
		$('.shop-info p ,.star-grade').css('line-height',pHeight+'px');


	})
</script>
<!-- <script type="text/javascript" src="../common/custom_temp/js/jquery-1.12.1.min.js"></script> -->
<script type="text/javascript" src="../../mshop/js/global.js"></script>
<script type="text/javascript" src="../common/custom_temp/js/doT.min.js"></script>
<script type="text/javascript" src="../common/custom_temp/js/custom.core.js"></script>
<!-- <script type="text/javascript" src="../common/custom_temp/js/jquery-ui.min.js"></script> -->
<script type="text/javascript" src="../common/custom_temp/js/jquery.touchSlider.js"></script>
<script type="text/javascript" src="../common/custom_temp/js/slider.js"></script>
<script type="text/javascript" src="../common/custom_temp/js/Marquee.js"></script>
<!-- <script type="text/javascript" src="../common/custom_temp/js/jquery.lazyload.js"></script> -->
<!-- <script type="text/javascript" src="../common/custom_temp/js/region_select.js"></script> -->
<!--<script type="text/javascript" src="../../common/js/lbs_select.js"></script>-->

<script type="text/javascript" src="../common/js/order_type5.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/jquery-cookie.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../mshop/js/goods/index_add_cart.js" charset="utf-8"></script>
	<script type="text/javascript">
	var pro_card_level="<?php echo $pro_card_level;?>";//购买产品需要会员卡开关
	var shop_card_id="<?php echo $shop_card_id;?>";//会员卡ID
	var user_id="<?php echo $user_id;?>";
	var customer_id = '<?php echo $customer_id;?>';
	get_product_number(); //更新购物车商品数量
	//localStorage.clear();
	//alert(user_id)
	//alert(localStorage.getItem("cart_"+user_id))
	function addToCart(is_QR,is_identity,is_virtual,pid,supply_id,pro_card_level_id,addtype){
        if(!checkUserLogin()) {
            return;
        }
	//if( from_type == 0 && user_id < 0 ){
	if(user_id < 0 ){
		document.location = "../../mshop/login.php?customer_id="+customer_id;
		return;
	}
	if( is_QR == 1 ){
		alert("二维码核销商品不能加入购物车");
		return;mshop
	}
	if( is_identity == 1){
		alert("身份证验证商品不能加入购物车");
		return;
	}
	if( is_virtual == 1 ){
		alert("虚拟商品不能加入购物车");
		return;
	}
	var pro_arr		= [];//产品信息数组：商品id、数量、属性
	var pro_arrs 	= [];//产品数组
	var sid_arr		= [];//商店数组
	var json_arr	= [];//整个购物车数组
	var pid 		= pid;//产品id
	var num 		= 1;//数量
	var supply_id 	= supply_id//供应商ID
//	var stock 		= $("#stock").text();//库存
	var pos_len 	= $(".active").length;
	var pos_arr 	= "";//选中属性id拼接字符串
	//check_storenum(pid); //检查库存
	//var aaa=check_proout(pid); //检查是否下架
	//console.log(aaa);
	if(check_proout(pid)==0){	//检查是否下架
		alert("商品已下架加入购物车失败！");
		return;
	}
	if(check_storenum(pid)==0){	//检查库存
		alert('库存不足加入购物车失败！');
		return;
	}

	if( pro_card_level == 1 && pro_card_level_id != -1){//检查会员卡是否有资格购买
		if(check_cardLevel(pro_card_level_id,shop_card_id)==0){
			alert('会员卡等级不足加入购物车失败！');
			return;
		}

	}

	for( i = 0; i < pos_len ; i++ ){
	var pos_id = $(".active").eq(i).attr("pos_id");
		if( pos_arr == "" ){
			pos_arr += pos_id;
		}else{
			pos_arr += "_"+pos_id;
		}
	}
	pro_arr.push(pid,num,pos_arr);
	//localStorage.clear();
	/*判断localStorage.cart是否存在开始*/
	
	if( !localStorage.getItem("cart_"+user_id) ){
		localStorage.setItem("cart_"+user_id,"");
	}
	
	var count = 0;
	/*判断localStorage.cart是否存在结束*/
	var json	= localStorage.getItem("cart_"+user_id);
	if(json != ""){
		json_arr = eval(json);
		var arr_sid = [];
		for( var i = 0; i < json_arr.length; i++){
			var sid = json_arr[i][0];//localStorage里的供应商id
			arr_sid.push(sid);
		}
		if( arr_sid.indexOf( supply_id ) > -1 ){
			for( var i = 0; i < json_arr.length; i++){
				var sid = json_arr[i][0];
				if( sid == supply_id ){
					var pid_arr = json_arr[i][1];
					var join = true;
					for( var j = 0; j < pid_arr.length; j++){
						var arr_pid = json_arr[i][1][j][0];//localStorage里的产品id
						var arr_pos = json_arr[i][1][j][2];//localStorage里的产品属性
						if( arr_pid == pid && arr_pos == pos_arr ){
							var arr_num = json_arr[i][1][j][1];//localStorage里的产品id
							if(addtype=='jia'){
								count = parseInt(arr_num)+parseInt(num);
							}else{
								count = parseInt(arr_num)-parseInt(num);
							}
							json_arr[i][1][j][1] = count;//修改数量
							 join = false;
							break;
						}

					}
					if( join ){
						json_arr[i][1].push(pro_arr);//对应供应商插入商品
					}
					break;
				}
			}
		}else{
			//插入新的供应商商品
			pro_arrs.push(pro_arr);
			sid_arr.push(supply_id,pro_arrs)
			json_arr.push(sid_arr);
		}
	}else{
		//插入新的供应商商品
		pro_arrs.push(pro_arr);
		sid_arr.push(supply_id,pro_arrs)
		json_arr.push(sid_arr);
	}

 	localStorage.setItem("cart_"+user_id,JSON.stringify(json_arr));
	get_product_number(); //更新购物车商品数量
	//console.log(json_arr);
	//console.log(localStorage.getItem("cart_"+user_id));

}

    var customer_id =<?php echo $customer_id;?>;
    var customer_id_en ='<?php echo $customer_id_en;?>';
    var diy_temid   =<?php echo $diy_temid;?>;
	var default_img   ="<?php echo $default_img;?>"; //异步加载默认图片
	var weixin_contact_num = '<?php echo $weixin_contact_num;?>';	//微信联系人个数
	var qq_contact_num = '<?php echo $qq_contact_num;?>';	//QQ联系人个数
	var phone_contact_num = '<?php echo $phone_contact_num;?>';	//电话联系人个数
	var exp_user_id = '<?php echo $exp_user_id;?>';
	// var oauth = '<?php echo $oauth;?>';
	var url_type = 1;
	var bottomMenu = <?php echo $bottomMenu;?>	//控制底部菜单栏显示，0：不显示，1显示

	//模拟滚动滚动条，处理app图片不能加载问题
	// window.onload = function () {
		// setTimeout(function () {
			// $(window).scrollTop(1);
			// setTimeout(function () {
				// $(window).scrollTop(0);
			// }, 100);
		// }, 100);
	// }


$(function() {
    // var typearr     =<?php echo json_encode($typearr);?>; //分类链接
    var customarr   =<?php echo json_encode($customarr);?>;//模块内容
	// var imginfoLst  =<?php echo json_encode($imginfoLst);?>;//图文消息数组
	// var typeLst   	=<?php echo json_encode($typeLst);?>;//分类数组
	// var fixedlink   =<?php echo json_encode($fixedlink);?>;//固定连接数组
    var new_baseurl   ="<?php echo $new_baseurl;?>";//固定链接前缀
	var local_city_name	= '<?php echo $city_name;?>';
	var now_time = '<?php echo $now_time;?>';
	proarr="";
    var test = eval(customarr);//   JSON转化为数组
    var city_name_auto = '<?php echo $city_name_auto;?>';
    var isused 	= '<?php echo $isused; ?>';
	var is_locate = '<?php echo $_REQUEST['is_locate'];?>';

	var microsshop_name = '<?php echo $microsshop_name;?>';
	var user_weixin_headimgurl = '<?php echo $user_weixin_headimgurl;?>';
	var status = '<?php echo $status;?>';

 //读取数据库数组生成页面
 try{
    for(i=0;i<test.length;i++)
    {
		if( test[i].type == 6 && bottomMenu == 0 ){
			continue;
		}
        var module={
                id:null,//模块ID
                type:null,//模块类型
                sort:null, //排序
                content:null,//模块内容
				product:null,//产品
				shoplist:null//店铺列表
          };
          module.content={
                css_type:null,
                placeholder:null,
                padding:null,
                margin:null,
                pro_title_show:null,
                pro_title_twoline:null,
                pro_numshow:null,
                show_sale:null,
                foot_position:null,
                video_link:null,
				bg_color:null,
				color:null,
				rolling_direction:null,
				rolling_speed:null,
				show_time_limit:null,
				city_name:null,
                dataset:[],
                shop_type:null,
                sort_type:null,
                divide_type:null
			};
		 	module.product={
                prodata:[]

                };
            module.shoplist={
                shopdata:[]

                };
            var titleArr=test[i].title.split("|");//拆出数组
            var imgArr=test[i].imgurl.split("|");
			var linkArr=test[i].link.split("|");
			var colorArr=test[i].color.split("|");

			if(test[i].start_time){
				var start_time_arr=test[i].start_time.split("|");
			}
			if(test[i].end_time){
				var end_time_arr=test[i].end_time.split("|");
			}
            console.log(test[i].end_time+'one');
         module.id=test[i].diy_tem_contid;
         module.type=test[i].type;
         module.content.css_type=test[i].css_type;
         module.content.placeholder=test[i].placeholder;
         module.content.padding=test[i].mod_padding;
         module.content.margin=test[i].mod_img_padding;
         module.content.pro_title_show=test[i].pro_title_show;
         module.content.pro_title_twoline=test[i].pro_title_twoline;
         module.content.pro_numshow=test[i].pro_numshow;
		 module.content.foreign_id=test[i].foreign_id;
         module.content.show_sale=test[i].show_sale;
         module.content.foot_position=test[i].foot_position;
         module.content.video_link=test[i].video_link;
		 module.content.bg_color=test[i].bg_color;
		 module.content.color=test[i].color;
		 module.content.rolling_direction=test[i].rolling_direction;
		 module.content.rolling_speed=test[i].rolling_speed;
		 module.content.show_time_limit=test[i].show_time_limit;
		 module.content.city_name=test[i].city_name;
		 module.content.now_time=now_time;
		 module.content.is_show=false;
		 module.content.shop_type=test[i].shop_type;
		 module.content.sort_type=test[i].sort_type;
		 module.content.divide_type=test[i].divide_type;
		 console.log(module.type,city_name_auto,is_locate);
		 if((module.type == 11 || module.type == 16) && city_name_auto == '' && is_locate!=1 ){
            $('#loading').show();
            $('#zhezhao_loc').show();
			getLocation(1);
		 }
		 if( microsshop_name && test[i].type==15 ){
        	module.content.placeholder=microsshop_name;
		 }

         for(j=0;j<titleArr.length-1;j++)
           {
            var newdata={
                    mod_sort:null,
                    link:"",
                    title:"",
                    color:"",
                    pic:"",
                    foreign_id:'',
                    detail_id:'',
                    start_time:'',
                    end_time:'',
					is_show: false
                };
            module.content.dataset.push(newdata);
            module.content.dataset[j].title=titleArr[j];
			module.content.dataset[j].link=linkArr[j];
			module.content.dataset[j].color=colorArr[j];
			if(!(module.content.dataset[j].link)){

				module.content.dataset[j].link="javascript:#;";
			}
            var picUrl=new_baseurl+imgArr[j];
            if(picUrl.indexOf("weixinpl")>0 || picUrl.indexOf("mshop")>0){ //默认图片输出defUrl
                module.content.dataset[j].pic=picUrl;
            }else{
                var defUrl=new_baseurl+"/weixinpl/common_shop/common/custom_temp/"+imgArr[j];
                module.content.dataset[j].pic=defUrl;
            }
            if( test[i].type==15 && status==1 && user_weixin_headimgurl ){
            	module.content.dataset[j].pic=user_weixin_headimgurl;
            }
			if(module.type == 12){
				if(start_time_arr[j]==''){
					module.content.dataset[j].start_time = 0;
                    console.log(start_time_arr[j]+'aaa');

				}else{
					// var timestamp = Date.parse(new Date(start_time_arr[j]+''));
					var timestamp = dateToTime(start_time_arr[j]);
					timestamp = parseInt(timestamp) / 1000;
					module.content.dataset[j].start_time=timestamp;
                    console.log(start_time_arr[j]+'aaa');

				}

				if(end_time_arr[j]==''){
					module.content.dataset[j].end_time=parseInt(now_time) + 3600;
				}else{
					// var timestamp2 = Date.parse(new Date(end_time_arr[j]));
					var timestamp2 = dateToTime(end_time_arr[j]);
					timestamp2 = parseInt(timestamp2) / 1000;
					module.content.dataset[j].end_time=timestamp2;
				}

				if(module.content.dataset[j].pic != '' && module.content.dataset[j].start_time<=now_time && module.content.dataset[j].end_time>=now_time && module.content.city_name == local_city_name){
					module.content.is_show = true;
					module.content.dataset[j].is_show = true;
				}

			}

        }
		if(module.type==5){
			if (module.content.shop_type == 0){
                console.log("foreign_id="+module.content.foreign_id);
				data=getproduct_custom(module.content.pro_numshow,module.content.foreign_id);
				if(data){
					for(k=0;k<data.length;k++){
						var newpro={
							pid:null,
							name:null,
							default_imgurl:null,
							now_price:null,
							orgin_price:null,
							count:null
						};
						module.product.prodata.push(newpro);
						module.product.prodata[k].pid=data[k].pid;
						module.product.prodata[k].name=data[k].name;
						module.product.prodata[k].default_imgurl=data[k].default_imgurl;
						module.product.prodata[k].now_price=data[k].now_price;
						module.product.prodata[k].orgin_price=data[k].orgin_price;
						module.product.prodata[k].count=data[k].count;
						module.product.prodata[k].now_count=data[k].now_count;
						module.product.prodata[k].buystart_time=data[k].buystart_time;
						module.product.prodata[k].base_buystart_time=data[k].base_buystart_time;
						module.product.prodata[k].countdown_time=data[k].countdown_time;
						module.product.prodata[k].isvalid=data[k].isvalid;
						module.product.prodata[k].is_supply_id=data[k].is_supply_id;
						module.product.prodata[k].storenum=data[k].storenum;
						module.product.prodata[k].tihuo_time = data[k].tihuo_time;

					}
				}
			}else if(module.content.shop_type == 1){
				data=get_cityarea_shop_product_custom(module.content.pro_numshow,module.content.foreign_id,module.content.divide_type);
				if(data){
					for(k=0;k<data.length;k++){
						var newpro={
							pid:null,
							name:null,
							default_imgurl:null,
							now_price:null,
							orgin_price:null,
							count:null,
							cityarea_id:-1,
							is_sharecard:0
						};
						module.product.prodata.push(newpro);
						module.product.prodata[k].pid=data[k].pid;
						module.product.prodata[k].name=data[k].name;
						module.product.prodata[k].default_imgurl=data[k].default_imgurl;
						module.product.prodata[k].now_price=data[k].now_price;
						module.product.prodata[k].orgin_price=data[k].orgin_price;
						module.product.prodata[k].count=data[k].count;
						module.product.prodata[k].now_count=data[k].now_count;
						module.product.prodata[k].base_buystart_time=data[k].base_buystart_time;
						module.product.prodata[k].countdown_time=data[k].countdown_time;
						module.product.prodata[k].cityarea_id=data[k].cityarea_id;
						module.product.prodata[k].is_sharecard=data[k].is_sharecard;
					}
				}
			}


		}

		if(module.type==16){
			data=get_cityarea_shop_custom(module.content.pro_numshow,module.content.sort_type,module.content.foreign_id);
			if(data){
				for(k=0;k<data['count'];k++){
					var newpro={
						shop_id:null,
						logo:null,
						label_image:null,
						is_sharecard:null,
						shop_name:null,
						evaluationAvg:null,
						label_image2:null,
						starting_fee:null,
						sell_count:null,
						distance:null,
						pay_admin:null,
						pay_owner:null
					};
					module.shoplist.shopdata.push(newpro);
					module.shoplist.shopdata[k].shop_id=data[k].shop_id;
					module.shoplist.shopdata[k].label_image2=data[k].label_image2;
					module.shoplist.shopdata[k].label_image=data[k].label_image;
					module.shoplist.shopdata[k].shop_name=data[k].shop_name;
					module.shoplist.shopdata[k].logo=data[k].logo;
					module.shoplist.shopdata[k].distance=data[k].distance;
					module.shoplist.shopdata[k].pay_admin=data[k].pay_admin;
					module.shoplist.shopdata[k].pay_owner=data[k].pay_owner;
					module.shoplist.shopdata[k].starting_fee=data[k].starting_fee;
					module.shoplist.shopdata[k].evaluationAvg=data[k].evaluationAvg;
					module.shoplist.shopdata[k].sell_count=data[k].sell_count;
					module.shoplist.shopdata[k].is_sharecard=data[k].is_sharecard;

				}

				module.content.show_sale = data['is_show_sales'];
			}

		}


        custom_build(module);//生成自定义模板
    }
	var wh = $(window).width();
	$('.one_pic img').height(wh/2);

	//跳转线下商城商家首页
    $(".shop-url").unbind("click").click(function(){
        shop_id = $(this).attr("shop-id");
        window.location.href="../../city_area/shop/supply_store.php?customer_id=" + customer_id_en +"&supply_id=" + shop_id;
    });

    //跳转线下商城商家到店付界面
    $(".shop-action").unbind("click").click(function(){
        shop_id = $(this).attr("shop-id");
        window.location.href="../../city_area/pay/pay_online.php?customer_id=" + customer_id_en +"&supply_id=" + shop_id + '&user_id=<?php echo passport_encrypt((string)$user_id);?>';
    });

	//模拟滚动滚动条
	setTimeout(function () {
		$(window).scrollTop(1);
		setTimeout(function () {
			$(window).scrollTop(0);
		}, 100);
	}, 100);

}catch(e){
	return false;
}

});
/*
 *	ios兼容问题，需要用此方法把日期转时间戳
 *	str格式：2011-11-11 11:11:11
 *	time	以毫秒为单位的时间戳
 */
function dateToTime(str){
	var new_str = str.replace(/:/g,'-');
	new_str = new_str.replace(/ /g,'-');
	var arr = new_str.split("-");
	var time = new Date(Date.UTC(arr[0],arr[1]-1,arr[2],arr[3]-8,arr[4],arr[5]));
	return time.getTime();
}
function subscribe(){	//点击关注
	showDialogImgBox("长按图中二维码，关注我吧！",'<?php echo $qr_imgurl;?>');
}

function headguide_edit(){	//点击编辑
	window.location.href = '../../mshop/headguide.php?customer_id=<?php echo $customer_id_en;?>';
}

function show_contact(type){	//显示联系人
	if(type == 1){
		if( qq_contact_num < 1){
			$(".dlg_content1_row2 img").css("width","30%");
			showDialogImgBox("目前还没有<br/>QQ的联系方式","../common/custom_temp/images/ku.png","知道了");
		}else{
			showDialogBox("长按复制QQ号<br/>赶紧加我QQ，和我联系吧！",$("#qqshowdetil").html(),"知道了");
		}
	}else if(type == 2){
		if( weixin_contact_num < 1){
			$(".dlg_content1_row2 img").css("width","30%");
			showDialogImgBox("目前还没有<br/>微信的联系方式","../common/custom_temp/images/ku.png","知道了");
		}else{
			showDialogBox("长按复制微信号<br/>赶紧加我微信，和我联系吧！",$("#weixinshowdetil").html(),"知道了");
		}
	}else if(type == 3){
		if( phone_contact_num < 1){
			$(".dlg_content1_row2 img").css("width","30%");
			showDialogImgBox("目前还没有<br/>电话的联系方式","../common/custom_temp/images/ku.png","知道了");
		}else{
			showDialogBox("点击电话或者短信，联系我吧！",$("#phoneshowdetil").html(),"知道了");
		}
	}
}

function getproduct_custom(pro_numshow,foreign_id){
	var op="getproduct";
	var dd="11";


	$.ajax({
			type : "POST",
			url : "getproduct_custom.php",
			async: false,
			data : 
            {
                "op" : op,
                "pro_numshow" : pro_numshow,
                "foreign_id" : "<?php echo $category_id?>",
                "customer_id"   : customer_id,
                "user_address"  : "<?php echo $user_address ?>"
            },
			dataType: "json",
			success : function(result) {

				proarr=result.msg;

			}

	});
	return proarr;
}

function get_cityarea_shop_product_custom(pro_numshow,foreign_id,divide_type){
	var op="get_product_list";
	var dd="11";
	$.ajax({
			type : "POST",
			url : "get_cityarea_shop_list_custom.php",
			async: false,
			data : {"op" : op,"pro_numshow" : pro_numshow,"type_ids" : foreign_id,"divide_type" : divide_type},
			dataType: "json",
			success : function(result) {

				proarr=result;

			}

	});
	return proarr;
}

function get_cityarea_shop_custom(pro_numshow,sort_type,foreign_id){
	var op="get_shop_list";
	var get_longitue = '<?php echo $_SESSION["longitude"]; ?>';
	var get_latitude = '<?php echo $_SESSION["latitude"]; ?>';
	$.ajax({
			type : "POST",
			url : "get_cityarea_shop_list_custom.php",
			async: false,
			data : {"op" : op,"shop_numshow" : pro_numshow,"sort_type" : sort_type,"longitude" : get_longitue,"latitude" : get_latitude,"type_ids" : foreign_id},
			dataType: "json",
			success : function(result) {
				proarr=result;

			}

	});
	return proarr;
}

function search_custom(){
	var searchname = document.getElementById("search_custom").value;
	var url="../../mshop/list.php?searchname="+searchname+"&customer_id=<?php echo $customer_id_en; ?>";
	document.location = url;
}

function citynav(){
	var this_url = window.location.href;
	var Cname = '<?php echo $city_name;?>';
	var Pname = '<?php echo $province_name;?>';
	var Aname = '<?php echo $area_name;?>';

	var citynav_url='../../back_nowpaySystem/cashplatform/citynav.php?from_url='+this_url+'&addr_P='+Pname+'&addr_C='+Cname+'&addr_A='+Aname;
	window.location.href=citynav_url;
}

function golocation(){
	if( typeof(location_info.city)=="undefined" ){
		location_info.city = '';
	}
	var local_province = location_info.province;
	var local_city = location_info.city;
	var local_area = '<?php echo $area_name;?>';
	var latitude = location_info.lat;
    var longitude = location_info.lng;
    var is_locate = 1;
	url='index.php?customer_id=<?php echo $customer_id_en;?>&Cname='+local_city+'&Pname='+local_province+'&Aname='+local_area+'&latitude='+latitude+'&longitude='+longitude+'&is_locate='+is_locate;
	if(exp_user_id > 0){
		url = url+"&exp_user_id="+exp_user_id;
	}
	if (diy_temid>0){
		url = url + '&diy_template_id='+diy_temid;
	}
	<?php if($owner_id>0){ ?>
	url = url + '&owner_id=<?php echo $owner_id;?>';
	<?php } ?>
	window.location.href=url;
}
</script>
<script type="text/javascript" src="js/jquery.lazyload.js"></script>
<script type="text/javascript" src="../common/custom_temp/js/custom.display.js"></script>

<!--自定义模板结束-->



<?php
  }else if($template_id==1){
?>
  <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div class="header">
    	<div class="shop_skin_index_list logo" rel="edit-t01">
        	<div class="img" style="height:40px;"><a href="index.php">
			</a></div>
        </div>
        <div class="login"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></div>
        <div class="clear"></div>
        <div class="search">

			<input type="text" class="input" id="searchname" name="searchname" value="" placeholder="输入商品名称..." onkeydown="if(event.keyCode==13){search_name();}">
			<input type="button" class="submit" onclick="search_name();" value="">
        </div>

    </div>
    <div class="shop_skin_index_list banner" rel="edit-t02">
        <div class="img"><div class="slider"><div class="flexslider">
		<div class="flex-viewport" style="overflow: hidden; position: relative;">
		<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
		<li class="clone" style="width: 1263px; float: left; display: block;">
		<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>">
		</a></li>

		</ul>
		</div></div></div></div>
    </div>
    <div class="menu">
    	<ul class="nav">
        	<li>

            	<a href="#">
                	<div class="shop_skin_index_list" rel="edit-t07" no="6" iscate="1">
					<div class="img"></div>
					</div>
                    <div class="name shop_skin_index_list" rel="edit-t11" no="10">
						<div class="div_typename"></div>
					</div>
                </a>

            </li>
        	<li>
            	<a href="#">
                	<div class="shop_skin_index_list" rel="edit-t08" no="7" iscate="1">
					<div class="img"></div>
					</div>
                    <div class="name shop_skin_index_list" rel="edit-t12" no="11">
						<div class="div_typename"></div>
					</div>
                </a>
            </li>
        	<li>
            	<a href="#">
                	<div class="shop_skin_index_list" rel="edit-t09" no="8" iscate="1">
					<div class="img"></div>
					</div>
                    <div class="name shop_skin_index_list" rel="edit-t13" no="12">
						<div class="div_typename"></div>
					</div>
                </a>
            </li>
        	<li>
            	<a href="#">
                	<div class="shop_skin_index_list" rel="edit-t10" no="9" iscate="1">
					<div class="img"></div>
					</div>
                    <div class="name shop_skin_index_list" rel="edit-t14" no="13">
						<div class="div_typename"></div>
					</div>
                </a>
            </li>
        </ul>
        <div class="blank9"></div>
        <ul class="ad">
        	<li>
	        	<div class="shop_skin_index_list" rel="edit-t03">
					<div class="img"></div>
			    </div>
		    </li>
        	<li>
				<div class="shop_skin_index_list" rel="edit-t04">
					<div class="img"></div>
				</div>
			</li>
        	<li>
				<div class="shop_skin_index_list" rel="edit-t05">
					<div class="img"></div>
				</div>
			</li>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="line"></div>
        <div class="box" id="list">
        <div class="shop_skin_index_list ad" rel="edit-t06"><div class="img"></div></div>
        <div class="ad_r">
         <?php
		    $query = "select id,name,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
			if(!empty($owner_typeids)){
				 //查找自己微店的产品
				 $query = $query." and (";
				 $owner_typeids_arr = explode(",",$owner_typeids);
				 $owner_typeids_count = count($owner_typeids_arr);
				 for($j=0;$j<$owner_typeids_count;$j++){
					 $o_typeid = $owner_typeids_arr[$j];
					 if($j==0){
						$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
					 }else{
						$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
					 }
				 }
				 $query = $query.")";
			  }
			  $query= $query." order by asort_value desc,id desc limit 0,2";

			$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
	        while ($row = mysql_fetch_object($result)) {
			   $name = $row->name;
			   $pid = $row->id;

			   $p_img = $row->default_imgurl;
			   if(empty($p_img)){
				   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
				   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
				   $p_img = "";
				   while ($row2 = mysql_fetch_object($result2)) {
					  $p_img= $row2->imgurl;
				   }
			   }

		 ?>
        	    <div class="item">
                	<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                        <div class="img"><img src="<?php echo $new_baseurl.$p_img;?>" data-original="<?php echo $new_baseurl.$p_img; ?>"></div>
                        <div class="name"><?php echo $name; ?></div>
                    </a>
                </div>
		<?php } ?>
         </div>
        <div class="clear"></div>
                <div class="box_0">
        	    <?php
                 $i=1;
				$query = "select id,name,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and  customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			  }
			   $query= $query." order by asort_value desc,id desc limit 2,18";

				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				$result_num=mysql_num_rows($result);
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;

				   $p_img = $row->default_imgurl;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }

		       ?>
					<div class="item">
							<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
								<div class="img"><img src="<?php echo $new_baseurl.$p_img;?>" data-original="<?php echo $new_baseurl.$p_img; ?>"></div>
								<div class="name"><?php echo $name; ?></div>
							</a>
						</div>
         <?php
					if(fmod($i,3)==0 && $i!=18 && $i!=$result_num){
						echo "<div class=\"clear\"></div></div> <div class=\"box_1\">";
					}

		           $i++;
		     }
            ?>
			<div class="clear"></div>
        </div>
    </div>

  </div>
  </div>

  <?php if($i==19){ ?>
  <div>
	<script type="text/javascript" src="../common/js/page/fengge1.js"></script>
	<div style="width:100%;height: 25px;margin-bottom: 5px;">
		<h1 style="background:#ddd;text-align:center;"><button type="button" id="more_commodity"  style="background:#ddd;color:#666;font-size:16px;width:100%;height: 25px;" onclick="get_commodity_detail('<?php echo $customer_id_en; ?>','<?php echo $owner_typeids?$owner_typeids:"-1"; ?>');">点击加载更多</button></h1>
	</div>
  </div>
  <?php } ?>

  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;float:left;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>


  <?php if($is_showbottom_menu){
    /*<div id="footer_points"></div>
  <footer id="footer">
	<ul>
		<li class="home"><a href="index.php?owner_id=<?php echo $owner_id; ?>"><img src="images/nav-0.jpg"> 首页</a></li>
		<li class="category"><a href="javascript:;"><img src="images/nav-1.jpg"> 分类</a></li>
		<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"><img src="images/nav-2.jpg"> 个人中心</a></li>
		<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>"><img src="images/nav-3.jpg"> 购物车</a></li>
	</ul>
 </footer>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
  } ?>
<?php }else if($template_id==2){?>

  <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
     <div class="header">
        <div class="shop_skin_index_list logo" rel="edit-t01">
            <div class="img"><a href=""></a></div>
        </div>
        <div class="search">
            <!-- <form action="../../mshop/list.php?op=search&customer_id=<?php echo $customer_id; ?>" method="post">
                <input type="text" name="keyword" class="input" value="" placeholder="输入商品名称...">
                <input type="submit" class="submit" value=" ">
            </form> -->
			<input type="text" id="searchname" class="input" name="searchname" value="" placeholder="输入商品名称...">
			<input type="button" class="submit" onclick="search_name()" value=" ">
        </div>
    </div>
    <div class="menu">
    	<ul>
        	<li>
			     <a href="#">
                	<div class="shop_skin_index_list" rel="edit-t04" no="3" iscate="1">
					<div class="img"></div>
					</div>
                    <div class="name shop_skin_index_list" rel="edit-t08" no="7">
						<div class="div_typename"></div>
					</div>
                </a>
            </li>
        	<li>
            	 <a href="#">
                	<div class="shop_skin_index_list" rel="edit-t05" no="4" iscate="1">
					<div class="img"></div>
					</div>
                    <div class="name shop_skin_index_list" rel="edit-t09" no="8">
						<div class="div_typename"></div>
					</div>
                </a>
            </li>
        	<li>
            	 <a href="#">
                	<div class="shop_skin_index_list" rel="edit-t06" no="5" iscate="1">
					<div class="img"></div>
					</div>
                    <div class="name shop_skin_index_list" rel="edit-t10" no="9">
						<div class="div_typename"></div>
					</div>
                </a>
            </li>
        	<li>
            	 <a href="#">
                	<div class="shop_skin_index_list" rel="edit-t07" no="6" iscate="1">
					<div class="img"></div>
					</div>
                    <div class="name shop_skin_index_list" rel="edit-t11" no="10">
						<div class="div_typename"></div>
					</div>
                </a>
            </li>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="box" id="list">
        <div class="shop_skin_index_list banner" rel="edit-t02">
            <div class="img"><div class="slider"><div class="flexslider">
				<div class="flex-viewport" style="overflow: hidden; position: relative;">
				<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
				<li class="clone" style="width: 1263px; float: left; display: block;">
				<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>">
				<img src="images/954b2f6394.jpg" data-original="images/954b2f6396.jpg" alt=""></a></li>

				</ul>
				</div></div></div>
			</div>
        </div>
        <div class="blank3"></div>
		    <?php
		    $query = "select id,name,now_price,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
			if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			}
			$query= $query." order by asort_value desc,id desc limit 0,2";
			$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
	        while ($row = mysql_fetch_object($result)) {
			   $name = $row->name;
			   $pid = $row->id;
			   $now_price = $row->now_price;
			   $p_img = $row->default_imgurl;
			   if(empty($p_img)){
				   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
				   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
				   $p_img = "";
				   while ($row2 = mysql_fetch_object($result2)) {
					  $p_img= $row2->imgurl;
				   }
			   }

		 ?>
		     <div class="item">
                <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                    <div class="img"><img src="<?php echo $new_baseurl.$p_img; ?>" data-original="<?php echo $new_baseurl.$p_img; ?>"></div>
					<strong><?php echo $name; ?></strong>
					<span>
					<?php if(OOF_P != 2) echo OOF_S ?>
					<?php echo $now_price; ?>
					<?php if(OOF_P == 2) echo OOF_S ?>
					</span>
                </a>
            </div>
		<?php } ?>

        <div class="clear"></div>
        <div class="shop_skin_index_list a0" rel="edit-t03">
            <div class="img" style="height:168px;"><a href="#"></a></div>
        </div>
        <div class="a1">
		          <?php
				$query = "select id,name,now_price,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			   }
			   $query= $query." order by asort_value desc,id desc limit 2,4";

                $i=1;
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;
				   $now_price=$row->now_price;
				   $p_img = $row->default_imgurl;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }

		       ?>

        	   <div class="item">
                    <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                        <div class="img"><img src="<?php echo $new_baseurl.$p_img;?>"  data-original="<?php echo $new_baseurl.$p_img; ?>"></div>
                        <strong><?php echo $name; ?></strong>
                        <span>
						<?php if(OOF_P != 2) echo OOF_S ?>
						<?php echo $now_price; ?>
						<?php if(OOF_P== 2) echo OOF_S ?>
						</span>
                    </a>
                </div>
			<?php
		           if(fmod($i,2)==0){
				      echo "<div class=\"clear\"></div>";
				   }

		           $i++;
		     }
            ?>
		</div>
		<div class="clear"></div>
		 <?php
				$query = "select id,name,now_price,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			   }
			   $query= $query." order by asort_value desc,id desc limit 4,16";
                $i=4;
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;
				   $now_price=$row->now_price;
				   $p_img = $row->default_imgurl;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }
			      $i++;
		       ?>
        	   <div class="item">
                    <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                        <div class="img"><img src="<?php echo $new_baseurl.$p_img;?>" data-original="<?php echo $new_baseurl.$p_img; ?>"></div>
                        <strong><?php echo $name; ?></strong>
                        <span>
						<?php if(OOF_P != 2) echo OOF_S ?>
						<?php echo $now_price; ?>
						<?php if(OOF_P == 2) echo OOF_S ?>
						</span>
                    </a>
                </div>
			<?php } ?>
	  </div>
	</div>
		<?php if($i==20){ ?>
		 <script type="text/javascript" src="../common/js/page/fengge2.js"></script>
		<div style="width:100%;height: 25px;margin-top:5px;margin-bottom:5px;">
			<h1 style="background:#ddd;text-align:center;"><button type="button" id="more_commodity"  style="background:#ddd;color:#666;font-size:16px;width:100%;height: 25px;" onclick="get_commodity_detail('<?php echo $customer_id_en; ?>','<?php echo $owner_typeids?$owner_typeids:"-1"; ?>');">点击加载更多</button></h1>
		</div>
		<?php } ?>
	</div>
	  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>

	<div id="footer_points"></div>
	<?php if($is_showbottom_menu){
   /*<footer id="footer">
	<ul>
		<li class="home"><a href="index.php"><img src="images/nav-0.jpg"> 首页</a></li>
		<li class="category"><a href="javascript:;"><img src="images/nav-1.jpg"> 分类</a></li>
		<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"><img src="images/nav-2.jpg"> 个人中心</a></li>
		<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>"><img src="images/nav-3.jpg"> 购物车</a></li>
	</ul>
   </footer>*/
   /*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
    } ?>
<?php }else if($template_id==3){?>

  <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
      <div class="header">
        <div class="search">
            <!-- <form action="../../mshop/list.php?op=search&customer_id=<?php echo $customer_id; ?>" method="post">
                <input type="text" name="keyword" class="input" value="" placeholder="输入商品名称...">
                <input type="submit" class="submit" value=" ">
            </form> -->
			<input type="text" id="searchname" class="input" name="searchname" value="" placeholder="输入商品名称...">
			<input type="button" class="submit" onclick="search_name()" value=" ">
        </div>
	  </div>
	  <div class="shop_skin_index_list banner" rel="edit-t01">
			<div class="img"><div class="slider"><div class="flexslider">
			<div class="flex-viewport" style="overflow: hidden; position: relative;">
			<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
			<li class="clone" style="width: 1263px; float: left; display: block;">
			<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>">
			</a></li>

			</ul>
			</div></div></div></div>
		</div>
		<div class="shop_skin_index_list a0" rel="edit-t02">
			<div class="img"><a href="">
			</a></div>
		</div>
		<div class="box">
			<ul>
				<li>
					<div class="shop_skin_index_list" rel="edit-t03">
						<div class="img">
						<a href="">

						</a></div>
					</div>
				</li>
				<li>
					<div class="shop_skin_index_list" rel="edit-t04">
						<div class="img"><a href="#">

						</a>
						</div>
					</div>
				</li>
				<li>
					<div class="shop_skin_index_list" rel="edit-t05">
						<div class="img">
						<a href="#">

						</a>
						</div>
					</div>
				</li>
				<li>
					<div class="shop_skin_index_list" rel="edit-t06">
						<div class="img"><a href="#">

						</a>
					  </div>
					</div>
				</li>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="shop_skin_index_list a0" rel="edit-t07">
			<div class="img"><a href="">

			</a></div>
		</div>
	</div>
	</div>
		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;margin-bottom:5px;padding:20px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div id="footer_points"></div>
	<?php if($is_showbottom_menu){
    /*<footer id="footer">
	<ul>
		<li class="home"><a href="index.php?owner_id=<?php echo $owner_id; ?>"> 首页</a></li>
		<li class="category"><a href="javascript:;"> 分类</a></li>
		<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"> 个人中心</a></li>
		<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>"> 购物车</a></li>
	</ul>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 } ?>
 </footer>
<?php }else if($template_id==4){?>
	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="shop_skin_index_list banner" rel="edit-t01">
			<div class="img"><div class="slider">
			<div class="flexslider"><div class="flex-viewport" style="overflow: hidden; position: relative;"><ul class="slides" style="width: 1200%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-2526px, 0, 0);"><li class="clone" style="width: 1263px; float: left; display: block;"><a href="">
			</a></li><li style="width: 1263px; float: left; display: block;" class=""><a href="#/api/2ec7422ced/shop/products/284/">
			</a></li></ul></div></div></div></div>
		</div>

	  <div id="index_prolist">
		<!--<h1><a href="../../mshop/list.php?isnew=1&customer_id=<!?php echo $customer_id; ?>&owner_id=<!?php echo $owner_id; ?>">新品上市</a></h1>-->
		<div class="shop_skin_index_list" rel="edit-t02" no="1">
			<h1><a class="div_typename" style="color:#666;font-size:16px;">新品上市</a></h1>
		</div>
		<div id="products">
			<div class="list-1" id="list">
		   <?php
			   	$query = "select id,name,now_price,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;

				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			   }
				$query= $query." order by asort_value desc,id desc limit 0,20";
                $i=1;
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;
				   $now_price=$row->now_price;
				   $p_img = $row->default_imgurl;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }

		       ?>
				<div class="item">
					<ul>
						<li class="img">
						<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
						<img src="<?php echo $new_baseurl.$p_img;?>" data-original="<?php echo $new_baseurl.$p_img; ?>"></a></li>
						<li class="name">
						<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
						<?php echo $name; ?></a>
						<span>
						<?php if(OOF_P != 2) echo OOF_S ?>
						<?php echo $now_price; ?>
						<?php if(OOF_P == 2) echo OOF_S ?>
						</span>
						</li>
					</ul>
				</div>
		  <?php
		           if(fmod($i,2)==0){
				      echo "<div class=\"clear\"></div>";
				   }

		           $i++;
		     }
            ?>

			</div>
		</div>
		<?php if($i==21){ ?>
		 <script type="text/javascript" src="../common/js/page/fengge4.js"></script>
		<div class="shop_skin_index_list" style="width:100%;margin-bottom: 10px;">
			<h1 style="background:#ddd;"><button type="button" id="more_commodity" class="div_typename" style="background:#ddd;color:#666;font-size:16px;width:100%;height: 25px;" onclick="get_commodity_detail('<?php echo $customer_id_en; ?>','<?php echo $owner_typeids?$owner_typeids:"-1"; ?>');">点击加载更多</button></h1>
		</div>
		<?php } ?>
	</div>
	</div>
	</div>
		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div id="footer_points"></div>
	<?php if($is_showbottom_menu){
	/*<footer id="footer">
		<ul>
		 <li class="category"><a href="javascript:;"> 分类</a></li>
		<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>"> 购物车</a></li>
		<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"> 个人中心</a></li>
		<li class="home"><a href="index.php?owner_id=<?php echo $owner_id; ?>"> 首页</a></li>
		</ul>
	</footer>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 } ?>
<?php }else if($template_id==5){?>


   <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="header">
			<div class="search">
				 <!--  <form action="../../mshop/list.php?op=search&customer_id=<?php echo $customer_id; ?>" method="post">
					<input type="text" name="keyword" class="input" value="" placeholder="输入商品名称...">
					<input type="submit" class="submit" value=" ">
				  </form> -->
				  <input type="text" id="searchname" class="input" name="searchname" value="" placeholder="输入商品名称...">
				<input type="button" class="submit" onclick="search_name()" value=" ">
			</div>
		</div>
		<div class="shop_skin_index_list banner" rel="edit-t01">
			<div class="img"><div class="slider"><div class="flexslider"><div class="flex-viewport" style="overflow: hidden; position: relative;"><ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-2526px, 0, 0);"><li class="clone" style="width: 1263px; float: left; display: block;"><a href="#/api/542929c34c/shop/products/2035/">
			</a></li></ul></div></div></div></div>
		</div>
		<div class="clear"></div>
		<div class="index_h">
			<div class="l">热销推荐</div>
			<div class="r"><a href="../../mshop/list.php?ishot=1&customer_id=<?php echo $customer_id_en; ?>">
			</a></div>
		</div>
		<div class="shop_skin_index_list i0" rel="edit-t02">
			<div class="img"><a href="#/api/542929c34c/shop/products/2350/">
			</a></div>
		</div>
		<div class="shop_skin_index_list i1" rel="edit-t03">
			<div class="img"><a href="#/api/542929c34c/shop/products/2035/">
			</a></div>
		</div>
		<div class="shop_skin_index_list i0" rel="edit-t04">
			<div class="img"><a href="#/api/542929c34c/shop/products/2080/"></a></div>
		</div>
		<div class="shop_skin_index_list i2" rel="edit-t05">
			<div class="img"><a href="#/api/542929c34c/shop/products/2361/"></a></div>
		</div>
		<div class="shop_skin_index_list i2" rel="edit-t06">
			<div class="img"><a href="#/api/542929c34c/tuan/"></a></div>
		</div>
	</div>
	<div id="index_prolist">
		<div class="index_h">
			<div class="l">最新产品</div>
			<div class="r">
			  <a href="../../mshop/list.php?isnew=1&customer_id=<?php echo $customer_id_en; ?>"><img src="../common/huazhuang/images/r.jpg"></a></div>
		</div>
		<div id="products">
			<div class="list-0" id="list">
			    <?php
				$query = "select id,name,now_price,introduce,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			   }
			   $query= $query." order by asort_value desc,id desc limit 0,20";
                $i=1;
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;
				   $now_price=$row->now_price;
				   $introduce = $row->introduce;
				   $p_img = $row->default_imgurl;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }

		       ?>
				<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
						<div class="item">
							<div class="img"><img src="<?php echo $new_baseurl.$p_img; ?>"></div>
							<div class="info">
								<h1><?php echo $name; ?></h1>
								<h2>
								<?php if(OOF_P != 2) echo OOF_S ?>
								<?php echo $now_price; ?>
								<?php if(OOF_P == 2) echo OOF_S ?>
								</h2>
								<h3><?php echo $introduce; ?></h3>
							</div>
							<div class="detail"><span></span></div>
						</div>
					</a>
				<?php
		           $i++;
		     }
            ?>
			</div>
		</div>
		<?php if($i==21){ ?>
		 <script type="text/javascript" src="../common/js/page/fengge5.js"></script>
		<div style="width:100%;height: 25px;margin-bottom: 15px;">
			<h1 style="background:#ddd;text-align:center;"><button type="button" id="more_commodity"  style="background:#ddd;color:#666;font-size:16px;width:100%;height: 25px;" onclick="get_commodity_detail('<?php echo $customer_id_en; ?>','<?php echo $owner_typeids?$owner_typeids:"-1"; ?>');">点击加载更多</button></h1>
		</div>
		<?php } ?>
	</div>
	</div>
		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div id="footer_points"></div>
	<?php if($is_showbottom_menu){
    /*<footer id="footer">
	<ul>
		<li class="category"><a href="javascript:;">
		<img src="../common/huazhuang/images/category.png"></a></li>
		<li class="cart">
		<a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
		<li class="member">
		<a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
		<li class="home">
		<a href="index.php">商城首页</a></li>
	</ul>
   </footer>*/
   /*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
    } ?>

<?php }else if($template_id==6){?>
	<style>
		#shop_skin_index .menu{height:80px;width:100%;float:left; border-top:1px solid #d1d1c9; border-bottom:2px solid #dedbd2; background:#fcfbf9; overflow:hidden;}
		#shop_skin_index .menu li{width:33%; height:80px; overflow:hidden; float:left; box-sizing:border-box; border-left:1px solid #e2e1df;}
		#shop_skin_index .menu li a{display:block; width:100%; overflow:hidden; text-align:center;}
		#shop_skin_index .menu  li  .name{height:20px; line-height:20px; text-align:center;}
		#shop_skin_index .menu  li  .img{height:60px;}
		#shop_skin_index .imgs img{width:38px;height:38px;}
		#products .list-0 .item .img img {width: 100px;height: 96px;}
		#products .list-0 .item .info {left: 115px;}
	</style>
	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="shop_skin_index_list banner" rel="edit-t01">
			<div class="img"><div class="slider">
			<div class="flexslider">
			<div class="flex-viewport" style="overflow: hidden; position: relative;">
			<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-2526px, 0, 0);"><li class="clone" style="width: 1263px; float: left; display: block;"><a href="#/api/c209e836af/shop/products/2066/">
			</a></li></ul></div></div></div></div>
		</div>
		 <div class="menu">
				<ul>
					<li>
					   <a href="#" style="cursor: default; text-decoration: none;" >
							<div class="shop_skin_index_list" rel="edit-t07" no="6" style="float:none;">
							<div class="img imgs"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t10" no="9" style="float:none;">
								<div class="div_typename"></div>
							</div>
						</a>
					</li>
					<li>
					   <a href="#" style="cursor: default; text-decoration: none;" >
							<div class="shop_skin_index_list" rel="edit-t08" no="7" style="float:none;">
							<div class="img imgs"></div>
							</div>
							 <div class="name shop_skin_index_list" rel="edit-t11" no="10" style="float:none;">
								<div class="div_typename"></div>
							</div>
						</a>
					</li>
					<li>
					   <a href="#" style="cursor: default; text-decoration: none;" >
							<div class="shop_skin_index_list" rel="edit-t09" no="8" style="float:none;">
							<div class="img imgs"></div>
							</div>
							 <div class="name shop_skin_index_list" rel="edit-t12" no="11" style="float:none;">
								<div class="div_typename"></div>
							</div>
						</a>
					</li>
				</ul>
				<div class="clear"></div>
			</div>
		<div class="shop_skin_index_list i0" rel="edit-t02">
			<div class="img"><a href="">
			</a></div>
		</div>
		<div class="shop_skin_index_list i1" rel="edit-t03">
			<div class="img"><a href=""></a></div>
		</div>
		<div class="shop_skin_index_list i0" rel="edit-t04">
			<div class="img"><a href=""></a></div>
		</div>
		<div class="shop_skin_index_list i2" rel="edit-t05">
			<div class="img"><a href=""></a></div>
		</div>
		<div class="shop_skin_index_list i2" rel="edit-t06">
			<div class="img"><a href=""></a></div>
		</div>
	</div>
	<div id="index_prolist">
		<div class="index_h">
			<div class="l">最新产品</div>
			<div class="r">
			  <a href="../../mshop/list.php?isnew=1&customer_id=<?php echo $customer_id_en; ?>"><img src="../common/huazhuang/images/r.jpg"></a></div>
		</div>
		<div id="products">
			<div class="list-0"  style="margin-bottom:50px;" id="list">
			    <?php
				$query = "select id,name,now_price,introduce,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			   }
			   $query= $query." order by asort_value desc,id desc limit 0,20";
                $i=1;
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;
				   $now_price=$row->now_price;
				   $introduce = $row->introduce;
				   $p_img = $row->default_imgurl;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }

		       ?>
				<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
						<div class="item">
							<div class="img"><img src="<?php echo $new_baseurl.$p_img;?>" data-original="<?php echo $new_baseurl.$p_img; ?>"></div>
							<div class="info">
								<h1><?php echo $name; ?></h1>
								<h2>
								<?php if(OOF_P != 2) echo OOF_S ?>
								<?php echo $now_price; ?>
								<?php if(OOF_P == 2) echo OOF_S ?>
								</h2>
								<h3><?php echo $introduce; ?></h3>
							</div>
						<div class="detail"><span></span></div>
					</div>
				</a>
				<?php
		           if(fmod($i,2)==0){
				      echo "<div class=\"clear\"></div>";
				   }

		           $i++;
		     }
            ?>
			</div>
		  <div style="margin-top: -45px; /*margin-bottom: 55px;*/">
			<script type="text/javascript" src="../common/js/page/fengge6.js"></script>
			<div style="width:100%;height: 25px;margin-bottom: 5px;">
				<h1 style="background:#ddd;text-align:center;"><button type="button" id="more_commodity"  style="background:#ddd;color:#666;font-size:16px;width:100%;height: 25px;" onclick="get_commodity_detail('<?php echo $customer_id_en; ?>','<?php echo $owner_typeids?$owner_typeids:"-1"; ?>');">点击加载更多</button></h1>
			</div>
		  </div>

		</div>


	</div>
	  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;margin-bottom:53px;padding:20px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<?php if($is_showbottom_menu){
	 /*<footer id="footer">
		<ul>
			<li class="category"><a href="javascript:;">产品分类</a></li>
			<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
			<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
			<li class="home"><a href="index.php">商城首页</a></li>
		</ul>
	</footer>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 } ?>
<?php }else if($template_id==7){?>

	 <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="shop_skin_index_list banner" rel="edit-t01" no="0">
			<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
		<!--<div id="SetHomeCurrentBox" style="height: 150px; width: 310px;"></div></div>-->
		<div class="box">
			<div>
				<div class="search">
					<!-- <form action="../../mshop/list.php?op=search&customer_id=<?php echo $customer_id; ?>" method="post">
						<input type="text" name="keyword" class="input" value="" placeholder="输入商品名称...">
						<input type="submit" class="submit" value=" ">
					</form> -->
					<input type="text" id="searchname" class="input" name="searchname" value="" placeholder="输入商品名称...">
					<input type="button" class="submit" onclick="search_name()" value="搜索" style="color:#000;">
				</div>
				<!--<a href="javascript:;" class="category" style="cursor: default; text-decoration: none;"></a>-->
			</div>
		</div>
		<script>
			$(document).ready(function(){
				var window_width=$(window).width();
				$(".banner img").css("width",window_width+"px");
				$(".banner img").css("height",window_width/2+"px");
				$(".list img").css("width",window_width+"px");
				$(".list img").css("height",window_width*11/64+"px");

			});
		</script>
		<div class="shop_skin_index_list list" rel="edit-t02" no="1">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list list" rel="edit-t03" no="2">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list list" rel="edit-t04" no="3">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list list" rel="edit-t05" no="4">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list list" rel="edit-t06" no="5">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list list" rel="edit-t07" no="6">
			<div class="img"></div>
		</div>
	</div>
	</div>
		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div id="footer_points"></div>
	<?php if($is_showbottom_menu){
	/*<footer id="footer">
		<ul>
			<li class="category"><a href="javascript:;">产品分类</a></li>
			<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
			<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
			<li class="home"><a href="index.php">商城首页</a></li>
		</ul>
	</footer>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
     } ?>
<?php }else if($template_id==8){?>


   <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="shop_skin_index_list banner" rel="edit-t01" no="0">
			<div class="img"></div>
			<div class="mod" style="display: none;">&nbsp;</div>
		<div id="SetHomeCurrentBox" style="height: 10px; width: 310px;"></div></div>

		<div id="index_m">
			<div  class="shop_skin_index_list"  rel="edit-t02"  no="1"><div  class="text"><a  href="../../mshop/list.php?ishot=1&customer_id=<?php echo $customer_id_en; ?>" class="div_typename" style="cursor: default; text-decoration: none;">热卖产品</a></div></div>
	        <div  class="shop_skin_index_list"  rel="edit-t03"  no="2"><div  class="text"><a  href="../../mshop/list.php?isnew=1&customer_id=<?php echo $customer_id_en; ?>" class="div_typename" style="cursor: default; text-decoration: none;">新品上市</a></div></div>

		</div>
</div>
</div>
<style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
<div id="footer_points"></div>
<script>
  	$('#shop_skin_index').bind('touchmove', function(e){e.preventDefault()});
</script>

<?php if($is_showbottom_menu){
/*<footer id="footer">
	<ul>
		<li class="category"><a href="javascript:;">产品分类</a></li>
		<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
		<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
		<li class="home"><a href="index.php">商城首页</a></li>
	</ul>
</footer>*/
/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
 } ?>

<?php }else if($template_id==9){?>

	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div  class="shop_skin_index_list banner"  rel="edit-t01">
			<div  class="img">
			<div  class="slider">
			<div  class="flexslider">
			<div  class="flex-viewport"  style="overflow: hidden; position: relative;">
			<ul  class="slides"  style="width: 1400%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-1263px, 0, 0);">
			<li  class="clone"  style="width: 1263px; float: left; display: block;">
			<a  href="#/api/fe0872e11c/shop/">
			</a></li>
			<li  style="width: 1263px; float: left; display: block;"  class="flex-active-slide"><a  href="#/api/fe0872e11c/web/column/99/"></a></li>
			<li  style="width: 1263px; float: left; display: block;"><a  href="#/api/fe0872e11c/shop/"></a></li>
			<li  style="width: 1263px; float: left; display: block;"><a  href="#/api/fe0872e11c/shop/"></a></li>
			<li  style="width: 1263px; float: left; display: block;"><a  href="#/api/fe0872e11c/shop/"></a></li>
			<li  style="width: 1263px; float: left; display: block;"><a  href="#/api/fe0872e11c/shop/"></a></li>
			<li  style="width: 1263px; float: left; display: block;"  class="clone"><a  href="#/api/fe0872e11c/web/column/99/"></a>
			</li></ul></div></div></div></div>
		</div>
		<div  class="shop_skin_index_list list"  rel="edit-t02">
			<div  class="img"><a  href="#/api/fe0872e11c/shop/products/161/"></a></div>
		</div>
		<div  class="shop_skin_index_list list"  rel="edit-t03">
			<div  class="img"><a  href="#/api/fe0872e11c/shop/products/157/"></a></div>
		</div>
		<div  class="shop_skin_index_list list"  rel="edit-t04">
			<div  class="img"><a  href="#/api/fe0872e11c/shop/products/162/"></a></div>
		</div>
		<div  class="shop_skin_index_list list"  rel="edit-t05">
			<div  class="img"><a  href="#/api/fe0872e11c/tuan/"></a></div>
		</div>
		<div  class="shop_skin_index_list list"  rel="edit-t06">
			<div  class="img"><a  href="#/api/fe0872e11c/tuan/"></a></div>
		</div>
		<div  class="shop_skin_index_list list"  rel="edit-t07">
			<div  class="img"><a  href="#/api/fe0872e11c/tuan/"></a></div>
		</div>
		<div  class="shop_skin_index_list list"  rel="edit-t08">
			<div  class="img"><a  href="#/api/fe0872e11c/tuan/"></a></div>
		</div>
		<div  class="shop_skin_index_list list"  rel="edit-t09">
			<div  class="img"><a  href="#/api/fe0872e11c/tuan/"></a></div>
		</div>
		<div  class="shop_skin_index_list list"  rel="edit-t10">
			<div  class="img"><a  href="#/api/fe0872e11c/tuan/"></a></div>
		</div>
	</div>
		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	</div><div id="footer_points"></div>
	<?php if($is_showbottom_menu){
	/*<footer id="footer">
		<ul>
			<li class="category"><a href="javascript:;">产品分类</a></li>
			<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
			<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
			<li class="home"><a href="index.php">商城首页</a></li>
		</ul>
	</footer>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
     } ?>
<?php }else if($template_id==10){?>


  <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div class="shop_skin_index_list banner" rel="edit-t01">
        <div class="img" style="height: 699px;"><div class="slider" style="height: 699px;"><div class="flexslider" style="height: 699px;">
		<div class="flex-viewport" style="overflow: hidden; position: relative; height: 699px;">
		<ul class="slides" style="width: 800%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-1280px, 0, 0); height: 699px;">

		<li style="height: 699px; width: 640px; float: left; display: block;" class="">
		<a href="//#/api/0c2ecc2872/microbar/" style="height: 699px;">
		<img src="../common/fushi2/images/banner.jpg" alt="" style="display: block"></a></li>
		</ul>
		</div></div></div></div>
    </div>
    <div id="index_m">
    	<div class="bg"></div>
        <div class="cont">
        	<div class="shop_skin_index_list" rel="edit-t02"><div class="text"><a href="#" class="div_typename">栏目1</a></div></div>
            <div>|</div>
            <div class="shop_skin_index_list" rel="edit-t03"><div class="text"><a href="#" class="div_typename">栏目</a></div></div>
            <div>|</div>
            <div class="shop_skin_index_list" rel="edit-t04"><div class="text"><a href="#" class="div_typename">栏目</a></div></div>
            <div>|</div>
            <div class="shop_skin_index_list" rel="edit-t05"><div class="text"><a href="#" class="div_typename">栏目</a></div></div>
        </div>
	</div>
</div>
	  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
</div><div id="footer_points"></div>
<?php if($is_showbottom_menu){ ?>

<!--<footer id="footer">
	<ul>
		<li class="category"><a href="javascript:;">产品分类</a></li>
		<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php //echo $customer_id_en;?>">购物车</a></li>
		<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php //echo $customer_id_en;?>">个人中心</a></li>
		<li class="home"><a href="index.php">商城首页</a></li>
	</ul>
</footer>-->
<?php
/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
?>
<script>
  	$('#shop_skin_index').bind('touchmove', function(e){e.preventDefault()});
</script>
<?php } ?>
<?php }else if($template_id==11){?>

  <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div  class="shop_skin_index_list banner"  rel="edit-t01">
        <div  class="img"  style="height: 842px;"><div  class="slider"  style="height: 842px;">
		<div  class="flexslider"  style="height: 842px;"><ul  class="slides"  style="height: 842px;">
		<li  style="display: list-item; height: 842px;">
		<a  href="#"  style="height: 842px;"></a></li></ul></div></div></div>
    </div>
 	<div  class="box">
    	<ul>
        	<li>
            	<div  class="shop_skin_index_list"  rel="edit-t02">
                	<div  class="img"><a  href="#"></a></div>
                    <div  class="text"><a  href="#"></a></div>
                </div>
            </li>
        	<li>
            	<div  class="shop_skin_index_list"  rel="edit-t03">
                	<div  class="img"><a  href="#"></a></div>
                    <div  class="text"><a  href="#"></a></div>
                </div>
            </li>
          </ul><ul>
        	<li>
            	<div  class="shop_skin_index_list"  rel="edit-t04">
                	<div  class="img"><a  href="#"></a></div>
                    <div  class="text"><a  href="#"></a></div>
                </div>
            </li>
        	<li>
            	<div  class="shop_skin_index_list"  rel="edit-t05">
                	<div  class="img"><a  href="#"></a></div>
                    <div  class="text"><a  href="#"></a></div>
                </div>
            </li>
        </ul>
        <div  class="clear"></div>
</div>
</div></div><div  id="footer_points"></div>
	  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;margin-bottom:36px;padding-20px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
<?php if($is_showbottom_menu){
/*<footer id="footer">
	<ul>
		<li class="category"><a href="javascript:;">产品分类</a></li>
		<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
		<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
		<li class="home"><a href="index.php">商城首页</a></li>
	</ul>
</footer>*/
/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
 } ?>
<?php }else if($template_id==12){?>


	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div  class="shop_skin_index_list top_column"  rel="edit-t02">

			<div  class="text"><span class="div_typename">标题</span></div>
		</div>
		<div  class="shop_skin_index_list banner"  rel="edit-t01">
			<div  class="img"><div  class="slider"><div  class="flexslider"><ul  class="slides"><li  style="display: list-item;">
			<a  href="#"></a></li></ul></div></div></div>
		</div>
		<div  class="shop_skin_index_list top_column"  rel="edit-t03">

			<div  class="text"><span class="div_typename">标题</span></div>
		</div>
		<div  id="index_prolist">
			<div  id="products">
			   <?php
			   	$query = "select id,name,now_price,orgin_price,introduce,default_imgurl,nowprice_title from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			   }
			   $query= $query." order by asort_value desc,id desc limit 0,10";
                $i=1;
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				$nowprice_title="";
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;
				   $now_price=$row->now_price;
				   $orgin_price = $row->orgin_price;
				   $introduce = $row->introduce;
				   $p_img = $row->default_imgurl;
				   $nowprice_title =$row->nowprice_title;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }
			   		$i++;
		       ?>
					<div  class="items">
					  <div  class="img"><a  href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
						<img  src="<?php echo $new_baseurl.$p_img; ?>"></a></div>
						<div  class="name"><a  href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><?php echo $name; ?></a></div>
						<div  class="desc"><?php echo $introduce; ?></div>

						<div  class="lbar fl">
							<div  class="price"><?php if($nowprice_title){echo $nowprice_title;}else if($base_nowprice_title){echo $base_nowprice_title;}else{echo "现价";}?>:
							<span>
							<?php if(OOF_P != 2) echo OOF_S ?>
							<?php echo $now_price; ?>
							<?php if(OOF_P == 2) echo OOF_S ?>
							</span></div>
							<div><del>原价:
							<?php if(OOF_P != 2) echo OOF_S ?>
							<?php echo $orgin_price; ?>
							<?php if(OOF_P == 2) echo OOF_S ?>
							</del>

							</div>
						</div>
						<div  class="rbar fr"><input  type="button"  class="btn" onclick="document.location='../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>';" value="立即购买"></div>
						<div  class="clear"></div>
						<input  type="hidden"  name="pid"  value="<?php echo $pid; ?>">


					</div>
			<?php }
			?>
			</div>

		<?php if($i==11){ ?>
		<div>
		<script type="text/javascript" src="../common/js/page/fengge12.js"></script>
		<div style="width:100%;height: 25px;margin-bottom: 20px;">
			<h1 style="background:#ddd;text-align:center;"><button type="button" id="more_commodity"  style="background:#ddd;color:#666;font-size:16px;width:100%;height: 25px;" onclick="get_commodity_detail('<?php echo $customer_id_en; ?>','<?php echo $owner_typeids?$owner_typeids:"-1"; ?>');">点击加载更多</button></h1>
		</div>
		</div>
		<?php } ?>
		</div>
	</div></div>
	  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div  id="footer_points"></div>

	<?php if($is_showbottom_menu){
	/*<footer  id="footer">
		<ul>
			<li class="category"><a href="javascript:;">分类</a></li>
		<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
		<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
		<li class="home"><a href="index.php">商城首页</a></li>
		</ul>
	</footer>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
     } ?>
<?php }else if($template_id==13){?>

   <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	<div  class="index_header">
			<div  class="lbar fl">
				<div  class="search">
				 <!-- <form action="../../mshop/list.php?op=search&customer_id=<?php echo $customer_id; ?>" method="post">
						<input type="text" name="keyword" class="input" value="" placeholder="输入商品名称...">
						<input type="submit" class="submit" value=" ">
					</form> -->
					<input type="text" id="searchname" class="input" name="searchname" value="" placeholder="输入商品名称...">
					<input type="button" class="submit" onclick="search_name()" value=" ">
				</div>
			 </div>
			<div  class="rbar fl"><a  href="#" onclick="goToOrderCart(<?php echo $from_type;?>)"  class="cart_icon"></a></div>
			<div  class="clear"></div>
		</div>
		<div  class="shop_skin_index_list banner"  rel="edit-t01">
			<div  class="img"><div  class="slider"><div  class="flexslider"><ul  class="slides">
			<li  style="display: list-item;"><a  href="#">
			</a></li></ul></div></div></div>
		</div>
		<div  class="shop_skin_index_list top_column"  rel="edit-t02"><div  class="text"><a href="#" class="div_typename">精选推荐</a></div></div>
		<div  id="index_prolist">

		   <?php
			   	$query = "select id,name,now_price,orgin_price,introduce,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			   }
			   $query= $query." order by asort_value desc,id desc limit 0,5";
                $i=1;
				$result = _mysql_query($query) or die('Query failed1: ' . mysql_error());
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;
				   $now_price=$row->now_price;
				   $orgin_price = $row->orgin_price;
				   $introduce = $row->introduce;
				   $p_img = $row->default_imgurl;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed2: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }
				  $i++;
		       ?>
				<div  class="items">
					<div  class="banner">
					<a  href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><img  src="<?php echo $new_baseurl.$p_img; ?>"></a></div>
					<div  class="cont">
					<div  class="lbar fl">
					<a  href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"  class="name"><?php echo $name; ?></a></div>
					<div  class="rbar fr"><span  class="price">
					<?php if(OOF_P != 2) echo OOF_S ?>
					<?php echo $now_price; ?>
					<?php if(OOF_P == 2) echo OOF_S ?>
					</span></div>
					<div  class="blank3"></div>
					<div  class="brief"><?php echo $introduce; ?></div>
					</div>
				</div>
			<?php }
			?>

		</div>
		<?php if($i==6){ ?>
		<div>
		<script type="text/javascript" src="../common/js/page/fengge13.js"></script>
		<div style="width:100%;height: 25px;margin-bottom: 5px;">
			<h1 style="background:#ddd;text-align:center;"><button type="button" id="more_commodity"  style="background:#ddd;color:#666;font-size:16px;width:100%;height: 25px;" onclick="get_commodity_detail('<?php echo $customer_id_en;?>',-1);">点击加载更多</button></h1>
		</div>
		</div>
		<?php } ?>

		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php

			$supporttype=-1; //1代表商城名字 2 代表公众号名字
			$supportname="";
			$support_fontcolor="";
			$support_linkurl="";
			$supportImg="";

	   		$support_query="select supporttype,supportname,support_fontcolor,support_linkurl,supportImg from customers where id=".$customer_id."";
			$result_support=_mysql_query($support_query) or die ('support_query faild' .mysql_error());
			while($row=mysql_fetch_object($result_support)){
				$supporttype=$row->supporttype;
				$supportname1=$row->supportname;
				$support_fontcolor=$row->support_fontcolor;
				$support_linkurl=$row->support_linkurl;
				$supportImg=$row->supportImg;
				}
			switch ($supporttype){
				case 1:
					$support_name="select name from weixin_commonshops where customer_id=".$customer_id."";
					$result_supportname=_mysql_query($support_name) or die ('support_name faild' .mysql_error());
					while($row=mysql_fetch_object($result_supportname)){
						$supportname=$row->name;
						}
					break;
				case 2:
					$support_name="select weixin_name from weixin_baseinfos where customer_id=".$customer_id."";
					$result_supportname=_mysql_query($support_name) or die ('support_name faild' .mysql_error());
					while($row=mysql_fetch_object($result_supportname)){
						$supportname=$row->weixin_name;
						}

					break;
				case 3:
					$supportname=$supportname1;
					break;
				}
			if($supportname){
		?>

			<div class="" style="width:100%;display:block;margin-bottom:70px;padding-top:20px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<?php if($is_showbottom_menu){
	/*<footer  id="footer">
		<ul>
		   <li  class="category"><a  href="javascript:;"><img  src="../common/jiazhuang/images/category.jpg"><br>产品分类</a></li>
		<li  class="cart"><a  href="order_cart.php?customer_id=<?php echo $customer_id_en;?>"><img  src="../common/jiazhuang/images/cart.jpg"><br>购物车</a></li>
		<li  class="member"><a  href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"><img  src="../common/jiazhuang/images/user.jpg"><br>个人中心</a></li>
		<li  class="home"><a  href="index.php"><img  src="../common/jiazhuang/images/home.jpg"><br>商城首页</a></li>

		</ul>
	</footer>*/
    /*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 } ?>
<?php }else if($template_id==14){?>


	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	  <div  class="shop_skin_index_list banner"  rel="edit-t01">
			<div  class="img"><div  class="slider"><div  class="flexslider"><ul  class="slides">
			<li  style="display: list-item;"><a  href="//#/api/0c2ecc2872/shop/">
			</a></li></ul></div></div></div>
		</div>
		<div  class="ind_one_box">
			<div  class="lbar fl">
				<div  class="shop_skin_index_list"  rel="edit-t02">
					<div  class="img"><a  href="#"></a></div>
				</div>
			</div>
			<div  class="rbar fr">
				<div  class="shop_skin_index_list"  rel="edit-t03">
				<div  class="img"><a  href="#"></a></div>
				</div>
			</div>
			<div  class="clear"></div>
		</div>

		<div  class="shop_skin_index_list ind_two_box"  rel="edit-t04">
			<div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div>
		</div>
		<div  class="ind_th_box">
			<div  class="lbar fl">
				<div  class="shop_skin_index_list"  rel="edit-t05">
					<div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div>
				</div>
			</div>
			<div  class="rbar fr">
				<ul>
					<li  class="fl mar_r mar_b">
						<div  class="shop_skin_index_list"  rel="edit-t06">
							<div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div>
						</div>
					</li>
					<li  class="fl mar_r mar_b">
						<div  class="shop_skin_index_list"  rel="edit-t07">
							<div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div>
						</div>
					</li>
					<li  class="fl mar_b">
						<div  class="shop_skin_index_list"  rel="edit-t08">
							<div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div>
						</div>
					</li>
									<li  class="fl mar_r">
						<div  class="shop_skin_index_list"  rel="edit-t09">
							<div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div>
						</div>
					</li>
									<li  class="fl mar_r">
						<div  class="shop_skin_index_list"  rel="edit-t10">
							<div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div>
						</div>
					</li>
									<li  class="fl">
						<div  class="shop_skin_index_list"  rel="edit-t11">
							<div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div>
						</div>
					</li>
								</ul>
			</div>
			<div  class="clear"></div>
		</div>
	</div></div>
	<style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div  id="footer_points"></div>

	<?php if($is_showbottom_menu){
	/*<footer  id="footer">
		<ul>
			<li class="category"><a href="javascript:;"></a></li>
			<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
			<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
			<li class="home"><a href="index.php">商城首页</a></li>
		</ul>
	</footer>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
     } ?>
<?php }else if($template_id==15){?>



     <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div  id="index_header">
			<div  class="lbar fl">
				<div  class="shop_skin_index_list logo"  rel="edit-t01">
					<div  class="img"></div>
				 </div>
			</div>
			<div  class="rbar fr">
				<div  class="head_menu">
					<a  href="#" onclick="goToOrderCart(<?php echo $from_type;?>)" class="cart"><img  src="../common/xie2/images/cart_icon.png"></a>
					<a  href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"  class="cate"  name="show_cate"><img  src="../common/xie2/images/cate_list.png"></a>
					<a  href="javascript:void(0)"  class="search"><img  src="../common/xie2/images/search_btn.png"></a>
				</div>
				<div  class="search_box">
				     <!-- <form action="../../mshop/list.php?op=search&customer_id=<?php echo $customer_id; ?>" method="post">
						<input type="text" name="keyword" class="input" value="" placeholder="输入商品名称...">
						<input type="submit" class="submit" value=" ">
					</form> -->
					<input type="text" id="searchname" class="input" name="searchname" value="" placeholder="输入商品名称...">
					<input type="button" class="submit" onclick="search_name()" value=" ">
				</div>
			</div>
			<div  class="clear"></div>
		</div>
		<div  class="shop_skin_index_list banner"  rel="edit-t02">
			<div  class="img"><div  class="slider"><div  class="flexslider"><ul  class="slides">
			<li  style="display: list-item;">
			<a  href="//#/api/0c2ecc2872/shop/">
			</a></li></ul></div></div></div>
		</div>

		<?php

		   $query="select id, name from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
		   if(!empty($owner_typeids)){
		      $query = $query." and id in (".$owner_typeids.")";
		   }
		  // $query=$query." order by id desc";
		  if($sort_str){
			$query =$query.' order by field(id'.$sort_str.')';
			}
		   $query= $query." limit 0,9";
		   $result = _mysql_query($query) or die('Query failed: ' . mysql_error());
		   $i=1;
		   while ($row = mysql_fetch_object($result)) {
			  $tid = $row->id;
			  $tname = $row->name;
			  $bgcolor = "bg_blue";
		      switch($i){
			     case 1:
				    break;
				case 2:
				    $bgcolor="bg_ff8b3e";
				    break;
				case 3:
				    $bgcolor="bg_78c92e";
				    break;
				case 4:
				    $bgcolor = "bg_blue";
				    break;
			    case 5:
				    $bgcolor="bg_ff8b3e";
				    break;
				case 6:
				    $bgcolor="bg_78c92e";
				    break;
				case 7:
				    $bgcolor = "bg_blue";
				    break;
			    case 8:
				    $bgcolor="bg_ff8b3e";
				    break;
				case 9:
				    $bgcolor="bg_78c92e";
				    break;
			  }
			  $i++;
		?>

			<div  class="products_cont">
				<ul>
					<li  class="column <?php echo $bgcolor; ?>"><a  href="../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>"><?php echo $tname; ?></a></li>

				</ul>
				<div  class="clear"></div>
			</div>
		<?php }

		?>

		</div></div>
		 <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
		<div  id="footer_points"></div>

		<?php if($is_showbottom_menu){
	/*<footer  id="footer">
		<ul>
			<li class="category"><a href="javascript:;"></a></li>
			<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
			<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
			<li class="home"><a href="index.php">商城首页</a></li>
		</ul>
	</footer>*/
     } ?>
<?php }else if($template_id==16){?>

	 <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	    <div  class="shop_skin_index_list banner"  rel="edit-t01">
			<div  class="img">
				<div  class="slider">
					<div  class="flexslider">
						<ul  class="slides">
							<li  style="display: list-item;">
							   <a  href="#">
							   </a>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<div  class="index-h">
			<div  class="items" style="height:79px">
				<a  href="#">
					<div class="shop_skin_index_list" style="height:56px;" rel="edit-t02" no="1"  iscate="1">
								<div class="img " style="background-size: 56px 56px;background-repeat: no-repeat;background-position: center;"></div>
					</div>
					<div class="name shop_skin_index_list"  rel="edit-t06" no="5" >
						<div class="div_typename div_font" ></div>
					</div>
				</a>
			</div>
			<div  class="items" style="height:79px">
				<a  href="#">
					<div class="shop_skin_index_list" style="height:56px;" rel="edit-t03" no="2"  iscate="1">
								<div class="img " style="background-size: 56px 56px;background-repeat: no-repeat;background-position: center;"></div>
					</div>
					<div class="name shop_skin_index_list"  rel="edit-t07" no="6" >
						<div class="div_typename div_font" ></div>
					</div>
				</a>
			</div>
			<div  class="items" style="height:79px">
				<a  href="#">
					<div class="shop_skin_index_list" style="height:56px;" rel="edit-t04" no="3"  iscate="1">
							<div class="img " style="background-size: 56px 56px;background-repeat: no-repeat;background-position: center;"></div>
					</div>
					<div class="name shop_skin_index_list"  rel="edit-t08" no="7" >
						<div class="div_typename div_font" ></div>
					</div>
				</a>
			</div>
			<div  class="items" style="height:79px">
				<a  href="#">
					<div class="shop_skin_index_list" style="height:56px;" rel="edit-t05" no="4"  iscate="1">
							<div class="img " style="background-size: 56px 56px;background-repeat: no-repeat;background-position: center;"></div>
					</div>
					<div class="name shop_skin_index_list"  rel="edit-t09" no="8" >
						<div class="div_typename div_font" ></div>
					</div>
				</a>
			</div>
<!-- 			<div  class="items"><a  href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"><img  src="../common/fushi7/images/vip_icon.png"><br>个人中心</a></div>
			<div  class="items"><a  href="../../mshop/list.php?isnew=1&customer_id=<?php echo $customer_id; ?>"><img  src="../common/fushi7/images/gift_icon.png"><br>最新产品</a></div>
			<div  class="items"><a  href="../../mshop/list.php?ishot=1&customer_id=<?php echo $customer_id; ?>"><img  src="../common/fushi7/images/home_icon.png"><br>热卖产品</a></div>
			<div  class="items"><a  href="order_cart.php?customer_id=<?php echo $customer_id_en;?>"><img  src="../common/fushi7/images/cart_icon.png"><br>购物车</a></div> -->
		</div>
		<?php

		   $query="select id, name from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
		   if(!empty($owner_typeids)){
		      $query = $query." and id in (".$owner_typeids.")";
		   }
		  // $query=$query." order by id desc";

			if($sort_str){
			 $query =$query.' order by field(id'.$sort_str.')';
			 }

		   $query= $query." limit 0,9";

		   $result = _mysql_query($query) or die('Query failed: ' . mysql_error());
		   $i=1;
		   while ($row = mysql_fetch_object($result)) {
			  $tid = $row->id;
			  $tname = $row->name;
			  $bgcolor = "bg_blue";
		      switch($i){
			     case 1:
				    break;
				case 2:
				    $bgcolor="bg_f8ca5a";
				    break;
				case 3:
				    $bgcolor="bg_ee7884";
				    break;
				case 4:
				    $bgcolor = "bg_blue";
				    break;
				case 5:
				    $bgcolor="bg_f8ca5a";
				    break;
				case 6:
				    $bgcolor="bg_ee7884";
				    break;
				case 7:
				    $bgcolor = "bg_blue";
				    break;
				case 8:
				    $bgcolor="bg_f8ca5a";
				    break;
				case 9:
				    $bgcolor="bg_ee7884";
				    break;
			  }
			  $i++;
		?>
		    <div  class="products_cont" onclick="document.location='../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>';">
				<div  class="title <?php echo $bgcolor; ?>"><a  href="../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>"  class="more">更多</a><?php echo $tname; ?></div>
				<div  class="cont">
					<ul  class="products_list">
										</ul>
				   <div  class="clear"></div>
				</div>
			</div>
		<?php }

		?>

		</div></div>
		 <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
		<div  id="footer_points"></div>

		<?php if($is_showbottom_menu){
	/*<footer  id="footer">
		<ul>
			<li class="category"><a href="javascript:;">产品分类</a></li>
			<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
			<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
			<li class="home"><a href="index.php">商城首页</a></li>
		</ul>
	</footer>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 } ?>

<?php }else if($template_id==17){?>

    <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div  class="shop_skin_index_list logo"  rel="edit-t01">
			<div  class="img"><a  href="#">
			</a></div>
		</div>
		<div  class="search_box">
			<!--  <form action="../../mshop/list.php?op=search&customer_id=<?php echo $customer_id; ?>" method="post">
				<input type="text" name="keyword" class="input" value="" placeholder="输入商品名称...">
				<input type="submit" class="submit" value=" ">
			</form> -->
			<input type="text" id="searchname" class="input" name="searchname" value="" placeholder="输入商品名称...">
			<input type="button" class="submit" onclick="search_name()" value=" ">
		 </div>
		<div  class="shop_skin_index_list banner"  rel="edit-t02">
			<div  class="img"><div  class="slider"><div  class="flexslider"><ul  class="slides"><li  style="display: list-item;"><a  href="//#/api/0c2ecc2872/shop/"></a></li></ul></div></div></div>
		</div>
		<div  class="index-h">
			<div  class="shop_skin_index_list items"  rel="edit-t08"  no="7"><div  class="img"  style="width:60px; height:80px;text-align:center;margin:0 auto;"><a  href="#" onclick="goToOrderCart(<?php echo $from_type;?>)"></a></div></div>
		    <div  class="shop_skin_index_list items"  rel="edit-t11"  no="10"><div  class="img"  style="width:60px; height:80px;text-align:center;margin:0 auto;"><a  href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>"></a></div></div>
		    <div  class="shop_skin_index_list items"  rel="edit-t10"  no="9"><div  class="img"  style="width:60px; height:80px;text-align:center;margin:0 auto;"><a  href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>&isnew=1"></a></div></div>
		    <div  class="shop_skin_index_list items"  rel="edit-t09"  no="8"><div  class="img"  style="width:60px; height:80px;text-align:center;margin:0 auto;"><a  href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"></a></div></div>
		</div>
		<div  class="ind_wrap">
			<div  class="ind_one_box">
				<div  class="lbar fl">
					<div  class="shop_skin_index_list"  rel="edit-t03"><div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div></div>
				</div>
				<div  class="rbar fr">
					<div  class="shop_skin_index_list"  rel="edit-t04"><div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div></div>
				</div>
				<div  class="clear"></div>
			</div>
			<div  class="ad_items"><div  class="shop_skin_index_list"  rel="edit-t05"><div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div></div></div>
					<div  class="products_list">

							<?php
							  $query = "select id,name,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
							  if(!empty($owner_typeids)){
							 //查找自己微店的产品
								 $query = $query." and (";
								 $owner_typeids_arr = explode(",",$owner_typeids);
								 $owner_typeids_count = count($owner_typeids_arr);
								 for($j=0;$j<$owner_typeids_count;$j++){
									 $o_typeid = $owner_typeids_arr[$j];
									 if($j==0){
										$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
									 }else{
										$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
									 }
								 }
								 $query = $query.")";
			                  }
			                  $query= $query." and ishot=1 limit 0,1";
							  $result = _mysql_query($query) or die('Query failed: ' . mysql_error());
							  while ($row = mysql_fetch_object($result)) {

							     $pid = $row->id;
								 $pname = $row->name;
							?>
							<div  class="items"><a  href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><?php echo $pname; ?></a></div>
							<?php } ?>
					  </div>
			<div  class="ad_items"><div  class="shop_skin_index_list"  rel="edit-t06"><div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div></div></div>
			<div  class="ad_items"><div  class="shop_skin_index_list"  rel="edit-t07"><div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div></div></div>
		</div>
	</div></div>
	 <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;margin-bottom:20px;padding:20px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div  id="footer_points"></div>

	<?php if($is_showbottom_menu){
	/*<footer  id="footer">
		<ul>
			<li  class="category"><a  href="javascript:;">全部分类</a></li>
			<li  class="cart"><a  href="order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
			<li  class="center"><a  href="index.php"><img  src="../common/huazhuang5/images/btm_home.png"></a></li>
			<li  class="hot"><a  href="../../mshop/list.php?ishot=1&customer_id=<?php echo $customer_id_en; ?>">热卖产品</a></li>
			<li  class="member"><a  href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
		</ul>
	</footer>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 } ?>
<?php }else if($template_id==18){?>


	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div  class="shop_skin_index_list banner"  rel="edit-t01">
			<div  class="img"><div  class="slider"><div  class="flexslider"><ul  class="slides">
			<li  style="display: list-item;"><a  href="//#/api/0c2ecc2872/shop/">
			</a></li></ul></div></div></div>
		</div>
		<div  class="ind_wrap">

		  <?php

		   $query="select id, name from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
		   if(!empty($owner_typeids)){
		      $query = $query." and id in (".$owner_typeids.")";
		   }
		   //$query=$query." order by id desc";

			if($sort_str){
			 $query =$query.' order by field(id'.$sort_str.')';
			 }

		   $query= $query." limit 0,5";
		   $result = _mysql_query($query) or die('Query failed: ' . mysql_error());
		   $i=1;
		   while ($row = mysql_fetch_object($result)) {
			  $tid = $row->id;
			  $tname = $row->name;

			  $i++;
		?>
		   	<div  class="category" onclick="document.location='../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>';">
				<h3><span  class="more">查看更多</span><?php echo $tname; ?></h3>
				<div  class="products">
            	                <div  class="clear"></div>
              </div>

			</div>

		<?php } ?>


				</div>
	</div></div>
	 <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div  id="footer_points"></div>

	<?php if($is_showbottom_menu){
	/*<footer  id="footer">
		<ul>
			<li class="category"><a href="javascript:;">分类</a></li>
			<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
			<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
			<li class="home"><a href="index.php">商城首页</a></li>
		</ul>
	</footer>*/
	 } ?>
<?php }else if($template_id==19){?>
	<link rel="stylesheet" type="text/css" href="../common/beijing/css/common.css">
    <link rel="stylesheet" type="text/css" href="../common/beijing/css/font-awesome.css">
    <link rel="stylesheet" type="text/css" href="../common/beijing/css/mall.css">
	    <link href="../common/fengge34/css/PreFoot.css" rel="stylesheet" type="text/css">
    <!--link rel="stylesheet" type="text/css" href="../common/beijing/css/PreFoot2.css">-->


  <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <!--topbar begin-->
    <section class="box" id="myorder">
        <div class="user_index">
            <div class="user_header" id="actionBar">
                <span  class="shop_skin_index_list top_column"  rel="edit-t02"  no="1">
		            <span  class="text"><a href="#" class="div_typename"></a></span>
                 </span>
                <span  class="shop_skin_index_list top_column"  rel="edit-t03"  no="2">
		            <span  class="text"><a href="#" class="div_typename"></a></span>
                 </span>
                <span><a href="#" onclick="goToOrderCart(<?php echo $from_type;?>)" class="shopping-cart">
                     <i class="fa fa-shopping-cart"></i>
                </a></span>
                <span  class="shop_skin_index_list top_column"  rel="edit-t13"  no="12">
		            <span  class="text"><a href="#" class="div_typename">标题</a></span>
                 </span>
            </div>
        </div>
    </section>


	<section class="box" id="banner">

	<div class="shop_skin_index_list banner"  rel="edit-t01" no="0">
			<div class="img"></div>
			<div class="mod" style="display: none;">&nbsp;</div>
		</div>

	<script>
	$(document).ready(function(){

	var window_width=$(window).width();
	var banner_height=window_width/2;
	$(".banner img").css("width",window_width+"px");
	$(".banner img").css("height",banner_height+"px");

	});
	</script>
	<!--<link rel="stylesheet" type="text/css" href="../common/beijing/css/scroll.css">
	<script language="javascript" src="../common/beijing/js/scroll.js" type="text/javascript"></script>
	<div class="pfhlkd_frame1">
		<div class="pfhlkd_mode0  pfhlkd_mf10001000"></div>
		<div class="pfhlkd_mode0  pfhlkd_mf10001005"></div>
		<div class="pfhlkd_mode0  pfhlkd_mf10001001">
			<div id="hdp_19" class="bd pfhlkd_bd_10">
				<div style="height:100%" class="shop_slider shop_slider_auto mod_pic_mt_1" data-tag="module-slider" data-height="320">
					<div style="height:100%" class="inner" rel="edit-t01"  data-tag="slider-warp" style="visibility: visible;">
					   <ul style="height:100%" class="pic_list"  id="ul_slider" data-tag="slider-list" style="width: 1920px;">

						</ul>

					</div>
					<div class="bar_wrap">
						<ul class="bar" data-tag="slider-page"><li class=""></li><li class=""></li><li class="cur"></li></ul>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script>
		$(function(){
			var hdp_19_width=$("#hdp_19").width();
			var hdp_19_hight=hdp_19_width/2;
			$("#hdp_19").css("height",hdp_19_hight+"px");
		});
	</script>
<style>
#hdp_19 .pic_list li{
	height:100%;
}
#hdp_19 .pp_init_img{
	height:100%;
}
</style>
-->
	</section>

    <section class="box" id="module">
        <div>
            <div class="user_nav clearfix">
                <ul class="user_nav_list">
                    <div style="display:none;">
                    <!--<li class="pro-class">
                        <a href="javascript:void(0)" id="menu" class="icon-s1"><span class="fa fa-th"></span>所有商品</a>
                        <div class="WX_cat_pop WX_cat_list J_smenu_list" id="menulist" style="display: none;">
                            <i class="WX_cat_btn-arrow"></i>
                           <?php
							  $query="select id, name from weixin_commonshop_types where isvalid=true and is_shelves=1 and customer_id=".$customer_id;
							   if(!empty($owner_typeids)){
								  $query = $query." and id in (".$owner_typeids.")";
							   }
							   $query=$query." order by id desc";

							  $result = _mysql_query($query) or die('Query failed: ' . mysql_error());

							  while ($row = mysql_fetch_object($result)) {
								  $tid=$row->id;
								  $tname = $row->name;
							?>
                            <a href="../../mshop/list.php?customer_id=<?php echo $customer_id; ?>&tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>" class="J_ytag WX_cat_sp"><?php echo $tname; ?></a>

                            <?php } ?>

                        </div>
                    </li>-->
					</div>
                    <li>
                    	<a id="menu" class="icon-s1"><div class="shop_skin_index_list" rel="edit-t04" no="3"  iscate="1"><div class="img" style="width:35px;height:35px;margin:0 auto;background-size:35px 35px;"></div></div>
                        <div class="name shop_skin_index_list"  rel="edit-t08" no="7"><div class="div_typename div_font" style="color:#fff"></div></div></a>
                    </li>

                    <li>
                    	<a id="menu" class="icon-s1"><div class="shop_skin_index_list" rel="edit-t05" no="4"  iscate="1"><div class="img" style="width:35px;height:35px;margin:0 auto;background-size:35px 35px;"></div></div>
                        <div class="name shop_skin_index_list"  rel="edit-t09" no="8"><div class="div_typename div_font" style="color:#fff"></div></div></a>
                    </li>

                    <li>
                        <a id="menu" class="icon-s1"><div class="shop_skin_index_list" rel="edit-t06" no="5"  iscate="1"><div class="img" style="width:35px;height:35px;margin:0 auto;background-size:35px 35px;"></div></div>
                        <div class="name shop_skin_index_list"  rel="edit-t10" no="9"><div class="div_typename div_font" style="color:#fff"></div></div></a>
                    </li>
                    <li>
                        <a id="menu" class="icon-s1"><div class="shop_skin_index_list" rel="edit-t07" no="6"  iscate="1"><div class="img" style="width:35px;height:35px;margin:0 auto;background-size:35px 35px;"></div></div>
                        <div class="name shop_skin_index_list"  rel="edit-t11" no="10"><div class="div_typename div_font" style="color:#fff"></div></div></a>
                    </li>

                </ul>
            </div>
        </div>
    </section>
    <div style="clear: both;"></div>
    <div class="user_itlist_nb">
        <div class="name shop_skin_index_list title" rel="edit-t12" no="11">
            <h2 class="div_typename div_font r_color"></h2>
        </div>
    </div>


    <section class="main_title" style="display: none" id="top2">

        <h2 id="topname"></h2>
        <a href="#" data-type="back" class="go-back" id="backurl"><span class="icons fa fa-angle-left" data-icon=""></span></a>

    </section>
    <div class="h30" id="h30" style="display: none"></div>

     <div class="WX_con" id="J_main" style="">
        <div class="jx">
            <div class="jx_list">

			   <?php
					  $query = "select id,name,unit,orgin_price,now_price,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
					  if(!empty($owner_typeids)){
					     //查找自己微店的产品
						 $query = $query." and (";
						 $owner_typeids_arr = explode(",",$owner_typeids);
						 $owner_typeids_count = count($owner_typeids_arr);
						 for($j=0;$j<$owner_typeids_count;$j++){
						     $o_typeid = $owner_typeids_arr[$j];
							 if($j==0){
  							    $query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }else{
							    $query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }
						 }
						 $query = $query.")";
					  }
					 // $query=$query." order by  ishot desc,id desc limit 0,10";
					  $query=$query." and isout=0 order by  asort_value desc,ishot desc,id desc limit 0,10";

					  $result = _mysql_query($query) or die('Query failed: ' . mysql_error());
					  while ($row = mysql_fetch_object($result)) {

						 $pid = $row->id;
						 $pname = $row->name;
						 $orgin_price = $row->orgin_price;
						 $now_price = $row->now_price;
						 $p_unit = $row->unit;
						 $p_img = $row->default_imgurl;
						   if(empty($p_img)){
							   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
							   $p_img = "";
							   while ($row2 = mysql_fetch_object($result2)) {
								  $p_img= $row2->imgurl;
							   }
						   }
					?>

                <div class="jx_g">
                    <div class="jx_g_img">
                        <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id; ?>" class="J_bi_product_item J_ytag">
                            <img class="" src="<?php echo $new_baseurl.$p_img; ?>">
                        </a>
                    </div>
                    <div class="jx_g_info">
                        <p class="jx_g_title">
                            <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id; ?>" class="J_bi_product_item J_ytag" data-dap="" data-pid="561592"><?php echo $pname; ?></a>
                        </p>
                        <p class="jx_g_price">
                            <span class="jx_g_price_wx">惊爆价<span>
							<i><?php if(OOF_P != 2) echo OOF_S ?></i>
							<?php echo $now_price; ?>
							<i><?php if(OOF_P == 2) echo OOF_S ?></i>
							</span>

                            </span><del class="jx_g_price_market">市场价
							<?php if(OOF_P != 2) echo OOF_S ?>
							<?php echo $orgin_price; ?>
							<?php if(OOF_P == 2) echo OOF_S ?>
							</del>
                        </p>
                        <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id; ?>" class="WX_btn jx_g_btn J_bi_product_item J_ytag" data-dap="" data-pid="561592">立即购买</a>
                    </div>
                </div>
				<?php } ?>
            </div>
            <div class="jx_map">

                <div class="jx_map_bd WX_cat_list">
					<?php
							  $query="select id, name from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
							   if(!empty($owner_typeids)){
								  $query = $query." and id in (".$owner_typeids.")";
							   }
		                     // $query=$query." order by id desc";

								if($sort_str){
								 $query =$query.' order by field(id'.$sort_str.')';
								 }

							  $result = _mysql_query($query) or die('Query failed: ' . mysql_error());

							  while ($row = mysql_fetch_object($result)) {
								  $tid=$row->id;
								  $tname = $row->name;
							?>
                            <a href="../../mshop/list.php?customer_id=<?php echo $customer_id; ?>&tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>" class="J_ytag WX_cat_sp"><?php echo $tname; ?></a>

                            <?php } ?>
                </div>
            </div>

        </div>
    </div>

	 <style>
		.foot_img img {width:60px;}
	  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;position:relative;padding:20px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<?php if($is_showbottom_menu){
	/*<div style="height:50px;display:block;width:100%;"></div>
	<div class="fixed bottom"><!--底部固定栏-->

            <dl class="sub-nav nav-b5">
                <dd>
                    <div class="nav-b5-relative shop_skin_index_list" rel="edit-t14" no="13"><i><div class="img"></div></i></div><div class="name shop_skin_index_list" rel="edit-t18" no="17">
                        <div class="div_typename div_font" ></div>
                    </div>
                </dd>
                <dd>
                    <div class="nav-b5-relative shop_skin_index_list" rel="edit-t15" no="14"><i><div class="img"></div></i></div><div class="name shop_skin_index_list" rel="edit-t19" no="18">
                        <div class="div_typename div_font" ></div>
                    </div>
                </dd>
                <dd>
                    <div class="nav-b5-relative shop_skin_index_list" rel="edit-t16" no="15"><i><div class="img"></div></i></div><div class="name shop_skin_index_list" rel="edit-t20" no="19">
                        <div class="div_typename div_font" ></div>
                    </div>
                </dd>
                <dd>
                    <div class="nav-b5-relative shop_skin_index_list" rel="edit-t17" no="16"><i><div class="img"></div></i></div><div class="name shop_skin_index_list" rel="edit-t21" no="20">
                        <div class="div_typename div_font" ></div>
                    </div>
                </dd>
            </dl>
    </div><!--底部结束-->*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 }?>

</div>

   <style>
    	.fixed .img img{width:22px!important;}



		.jx_map{margin-bottom:5px;}
		.fixed .div_typename{height:20px;overflow:hidden;}
    </style>






<script type="text/javascript">

        //注册当页面发生滚动事件的时候，判断他有没有滚动条，如果有滚动条就显示“返回”，如果没有就不返回
        window.onscroll = test;
        function test() {
            if ($('body').scrollTop() == 0) {
                $('#gotopbtn').removeClass("WX_backtop_active");
            } else {
                $('#gotopbtn').addClass("WX_backtop_active");
            }
        }
        $('#menu').click(function () {
            $('#menulist').toggle();
        });



    </script>
<?php }else if($template_id==20){?>
	<link  rel="stylesheet"  href="../common/fushi_20/css/style.css">
	<link  rel="stylesheet"  href="../common/fushi_20/css/header_style8.css">
    <link href="../common/fushi2/css/shop.css" rel="stylesheet" type="text/css">
    <link href="../common/fushi2/css/index.css" rel="stylesheet" type="text/css">
	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	<div class="shop_skin_index_list banner" rel="edit-t01">
        <div class="img" style="height: 100%;"><div class="slider" style="height: 100%;"><div class="flexslider" style="height: 100%;">
		<div class="flex-viewport" style="overflow: hidden; position: relative; height: 100%;">
		<ul class="slides" style="width: 800%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-1280px, 0, 0); height: 100%;">

		<li style="height: 100%; width: 640px; float: left; display: block;" class="">
		<a href="//#/api/0c2ecc2872/microbar/" style="height: 100%;">
		<img src="../common/fushi2/images/banner.jpg" alt=""></a></li>
		</ul>
		</div></div></div></div>
    </div>
    <div  id="index_m" style="position:fixed;bottom:0px;">

		<div  class="mobile8_nav">
             <ul>
				<li>

					<span class="shop_skin_index_list" rel="edit-t02"  no="1" style="margin-top:5px;"><span class="img" style="margin-top:-10px"><img  src="../common/fushi_20/images/ind1-1.png"  width="32"  height="25"></span></span>
					<span class="shop_skin_index_list" rel="edit-t06"  no="5" style="margin-top:-30px;"><span class="text"><a  href="#" class="div_typename">栏目</a></span></span>
					<span class="shop_skin_index_list" rel="edit-t10"  no="9" style="margin-top:-35px;"><span class="text"><b><a  href="#" class="div_typename">栏目</a></b></span></span>
				</li><li>

					 <span class="shop_skin_index_list" rel="edit-t03"  no="2"  style="margin-top:5px;"><span class="img" style="margin-top:-10px"><img  src="../common/fushi_20/images/ind1-2.png"  width="32"  height="25"></span></span>
					 <span class="shop_skin_index_list" rel="edit-t07"  no="6" style="margin-top:-30px;"><span class="text"><a  href="#" class="div_typename">栏目</a></span></span>
					 <span class="shop_skin_index_list" rel="edit-t11"  no="10" style="margin-top:-35px;"><span class="text" ><b><a  href="#" class="div_typename">栏目</a></b></span></span>

				</li><li>
						<span class="shop_skin_index_list" rel="edit-t04"  no="3"  style="margin-top:5px;"><span class="img" style="margin-top:-10px"><img  src="../common/fushi_20/images/ind1-3.png"  width=""  height="25"></span></span>
						<span class="shop_skin_index_list" rel="edit-t08"  no="7" style="margin-top:-30px;"><span class="text"><a  href="#" class="div_typename">栏目</a></span></span>
						<span class="shop_skin_index_list" rel="edit-t12"  no="11" style="margin-top:-35px;"><span class="text"><b><a  href="#" class="div_typename">栏目</a></b></span></span>
				</li><li>
					  <span class="shop_skin_index_list" rel="edit-t05"  no="4"  style="margin-top:5px;"><span class="img" style="margin-top:-10px"><img  src="../common/fushi_20/images/ind1-4.png"  width="32"  height="25"></span></span>
						<span class="shop_skin_index_list" rel="edit-t09"  no="8" style="margin-top:-30px;"><span class="text"><a  href="#" class="div_typename">栏目</a></span></span>
						<span class="shop_skin_index_list" rel="edit-t13"  no="12" style="margin-top:-35px;"><span class="text"><b><a  href="#" class="div_typename">栏目</a></b></span></span>

				</li>
			</ul>
		</div>

		 <style>
  	.foot_img img {width:60px;}

  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;position:relative;bottom:-15px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>

		<style>
		.foot_img img {width:60px;}
		#category{display:none;}
		</style>

	</div>

</div>

</div>

<script>
  	$('#shop_skin_index').bind('touchmove', function(e){e.preventDefault()});
</script>
<?php }else if($template_id==21){?>
	<link  rel="stylesheet"  href="../common/fushi_21/css/style.css">
	<link href="../common/fushi2/css/shop.css" rel="stylesheet" type="text/css">
    <link href="../common/fushi2/css/index.css" rel="stylesheet" type="text/css">
	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	<div class="shop_skin_index_list banner" rel="edit-t01">
        <div class="img" style="height: 100%;"><div class="slider" style="height: 100%;"><div class="flexslider" style="height: 100%;">
		<div class="flex-viewport" style="overflow: hidden; position: relative; height: 100%;">
		<ul class="slides" style="width: 800%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-1280px, 0, 0); height: 100%;">

		<li style="height: 100%; width: 640px; float: left; display: block;" class="">
		<a href="//#/api/0c2ecc2872/microbar/" style="height: 100%;">
		<img src="../common/fushi2/images/banner.jpg" alt=""></a></li>
		</ul>
		</div></div></div></div>
    </div>
      <div  id="index_m" style="top:50px;">
	   <div  class="membersbox pad50">

			<div  class="homeBbox">
						<span class="shop_skin_index_list" rel="edit-t02"  no="1"><span class="text"><a  href="#" class="div_typename" style="padding-top:20px;">栏目</a></span></span>
						<span class="shop_skin_index_list" rel="edit-t03"  no="2"><span class="text"><a  href="#" class="div_typename" style="padding-top:20px;">栏目</a></span></span>
						<span class="shop_skin_index_list" rel="edit-t04"  no="3"><span class="text"><a  href="#" class="div_typename" style="padding-top:20px;">栏目</a></span></span>
						<span class="shop_skin_index_list" rel="edit-t05"  no="4"><span class="text"><a  href="#" class="div_typename" style="padding-top:20px;">栏目</a></span></span>
			</div>

        </div>
	</div>

</div>
  <style>
  	.foot_img img {width:60px;}
		#category{display:none;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
</div><div id="footer_points">
	<div  class="nav">
				<section  class="inner">

					<section  class="nav-lists hasmenu0">
						<dl  class="nav-item j-showNavSub fl">
								<dt><a  href="index.php">首页</a></dt>
							</dl>
							<dl  class="nav-item j-showNavSub fl">
								<dt><a  href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></dt>
							</dl>
							<dl  class="nav-item j-showNavSub fl">
								<dt><a  href="../../mshop/list.php">所有商品</a></dt>
							</dl>
										</section>
				</section>
			</div>

</div>
<script>
  	$('#shop_skin_index').bind('touchmove', function(e){e.preventDefault()});
</script>
<?php }else if($template_id==22){?>
	<link  rel="stylesheet"  href="../common/fushi_22/css/style.css">
    <link  rel="stylesheet"  type="text/css"  href="../common/fushi_22/css/idangerous.swiper.css">

	<link href="../common/fushi2/css/shop.css" rel="stylesheet" type="text/css">
    <link href="../common/fushi2/css/index.css" rel="stylesheet" type="text/css">
	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="shop_skin_index_list banner" rel="edit-t01">
			<div class="img" style="height: 100%;"><div class="slider" style="height: 100%;"><div class="flexslider" style="height: 100%;">
			<div class="flex-viewport" style="overflow: hidden; position: relative; height: 100%;">
			<ul class="slides" style="width: 800%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-1280px, 0, 0); height: 100%;">

			<li style="height: 100%; width: 640px; float: left; display: block;" class="">
			<a href="//#/api/0c2ecc2872/microbar/" style="height: 100%;">
			<img src="../common/fushi2/images/banner.jpg" alt=""></a></li>
			</ul>
			</div></div></div></div>
		</div>
        <div  id="index_m" style="top:10px;">
	   <div  class="membersbox pad50">

		   <div  class="homeCpay"  style="top:130px;">
		     <span class="shop_skin_index_list" rel="edit-t04"  no="3"><span class="text"><a  href="#" class="div_typename">所有商品</a></span></span>
		   </div>
			<div  class="homeCcon">
				<span class="shop_skin_index_list" rel="edit-t02"  no="1"><span class="text"><a  href="#" class="div_typename" style="color:#ff0000;font-size:18px;line-height:40px">大标题</a></span></span>
				<span class="shop_skin_index_list" rel="edit-t03"  no="2"><span class="text"><a  href="#" class="div_typename" style="color:#ff0000">小标题</a></span></span>

			</div>
			<div  class="homeCnav" style="position:fixed;bottom:44px;">
				<div  class="homeCnavbox swiper-container">
					<ul  class="swiper-wrapper"  style="width: 100%; height: 80px;">
						<li  class="swiper-slide"  style="width: 25%; height: 80px;">
							<span    class="homeCnavbox_a_colblue"  style="background-color: #07a0e7">
								<h2><span class="shop_skin_index_list" rel="edit-t05"  no="4"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">大标题</a></span></span></h2>
								<div  class="shop_skin_index_list items"  rel="edit-t09"  no="8" style="width:25px;text-align:center;margin:0 auto;"><div  class="img"></div></div>
							</span>
						</li>
						<li  class="swiper-slide"  style="width: 25%; height: 80px;">
							<span   class="homeCnavbox_a_colgreen"  style="background-color: #72c201">
								<h2><span class="shop_skin_index_list" rel="edit-t06"  no="5"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">大标题</a></span></span></h2>
								<div  class="shop_skin_index_list items"  rel="edit-t10"  no="9" style="width:25px;text-align:center;margin:0 auto;"><div  class="img"></div></div>
							</span>
						</li>
						<li  class="swiper-slide"  style="width: 25%; height: 80px;">
							<span   class="homeCnavbox_a_colyellow"  style="background-color: #ffa800">
								<h2><span class="shop_skin_index_list" rel="edit-t07"  no="6"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">大标题</a></span></span></h2>
								<div  class="shop_skin_index_list items"  rel="edit-t11"  no="10" style="width:25px;text-align:center;margin:0 auto;"><div  class="img"></div></div>
							</span>
						</li>
						<li  class="swiper-slide"  style="width: 25%; height: 80px;">
							<span   class="homeCnavbox_a_colred"  style="background-color: #d50303">
								<h2><span class="shop_skin_index_list" rel="edit-t08"  no="7"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">大标题</a></span></span></h2>
								<div  class="shop_skin_index_list items"  rel="edit-t12"  no="11" style="width:25px;text-align:center;margin:0 auto;"><div  class="img"></div></div>
							</span>
						</li>                </ul>
				</div>
			</div>



		</div>
	</div>

</div>
</div>
<style>
  	.foot_img img {width:60px;}
#category{display:none;}
  </style>
  <script>
//	var winh=$(window).height();
//	$(".homeCnav").css("top",winh-45+"px");
  </script>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
<div id="footer_points">

	<div  class="nav">
				<section  class="inner">

					<section  class="nav-lists hasmenu0">
						<dl  class="nav-item j-showNavSub fl">
								<dt><a  href="index.php">首页</a></dt>
							</dl>
							<dl  class="nav-item j-showNavSub fl">
								<dt><a  href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></dt>
							</dl>
							<dl  class="nav-item j-showNavSub fl">
								<dt><a  href="../../mshop/list.php">所有商品</a></dt>
							</dl>
										</section>
				</section>
			</div>
</div>
<?php }else if($template_id==23){?>
<link  rel="stylesheet"  href="../common/fushi_23/css/style.css">
<link  rel="stylesheet"  href="../common/fushi_20/css/header_style8.css">
<link href="../common/fushi2/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/fushi2/css/index.css" rel="stylesheet" type="text/css">
<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	<div class="shop_skin_index_list banner" rel="edit-t01">
        <div class="img" style="height: 100%;">
			<div class="slider" style="height: 100%;">
				<div class="flexslider" style="height: 100%;">
					<div class="flex-viewport" style="overflow: hidden; position: relative; height: 100%;">
						<ul class="slides" style="width: 800%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-1280px, 0, 0); height: 100%;">
							<li style="height: 100%; width: 640px; float: left; display: block;" class="">
								<a href="//#/api/0c2ecc2872/microbar/" style="height: 100%;">
									<img src="../common/fushi_23/images/banner.jpg" alt="">
								</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
    </div>

    <div  id="index_m" style="bottom:0px;position:fixed;">
	<style>
		.swiper-wrapper img {width:35px!important;height:35px!important;}
	</style>
		<div  class="membersbox pad50">
			<div  class="homeAbox">
				<div  class="homeA swiper-container">
					<ul  class="swiper-wrapper"  style="width: 100%;height: 235px;">
						<li  class="swiper-slide"  style="width: 25%; height: 135px;">
							<h2><span class="shop_skin_index_list" rel="edit-t02"  no="1"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">栏目</a></span></span></h2>
							<span class="shop_skin_index_list" rel="edit-t06"  no="5"><span class="img" ><img  src="../common/fushi_23/images/ind1-1.png"></span></span>
							<div class="homeA_span" style="width:100%;"><span class="shop_skin_index_list" rel="edit-t10"  no="9"><span class="text"><a  href="#" class="div_typename" style="color: #0680ad;">栏目</a></span></span></div>
							<b></b>
						</li>
						<li  class="swiper-slide"  style="width: 25%; height: 135px;">

								<h2><span class="shop_skin_index_list" rel="edit-t03"  no="2"><span class="text"><a  href="#" class="div_typename"  style="color:#fff;">栏目</a></span></span></h2>
								<span class="shop_skin_index_list" rel="edit-t07"  no="6" ><span class="img" ><img  src="../common/fushi_23/images/ind1-2.png"  width="32"  height="25"></span></span>
								<div class="homeA_span" style="width:100%;"><span class="shop_skin_index_list" rel="edit-t11"  no="10"><span class="text"><a  href="#" class="div_typename" style="color: #0680ad;">栏目</a></span></span></div>
								<b></b>

						</li>
						<li  class="swiper-slide"  style="width: 25%; height: 135px;">

								<h2><span class="shop_skin_index_list" rel="edit-t04"  no="3"><span class="text"><a  href="#" class="div_typename"  style="color:#fff;">栏目</a></span></span></h2>
								<span class="shop_skin_index_list" rel="edit-t08"  no="7" ><span class="img" style="margin-top:-15px;"><img  src="../common/fushi_23/images/ind1-3.png"  width="32"  height="25"></span></span>
								<div class="homeA_span" style="width:100%;"><span class="shop_skin_index_list" rel="edit-t12"  no="11"><span class="text"><a  href="#" class="div_typename" style="color: #0680ad;">栏目</a></span></span></div>
								<b></b>

						</li>
						<li  class="swiper-slide"  style="width: 25%; height: 135px;">

								<h2><span class="shop_skin_index_list" rel="edit-t05"  no="4"><span class="text"><a  href="#" class="div_typename"  style="color:#fff;">栏目</a></span></span></h2>
								<span class="shop_skin_index_list" rel="edit-t09"  no="8" style="margin-top:8px;"><span class="img" style="margin-top:-15px;"><img  src="../common/fushi_23/images/ind1-4.png"  width="32"  height="25"></span></span>
								<div class="homeA_span" style="width:100%;"><span class="shop_skin_index_list" rel="edit-t13"  no="12"><span class="text"><a  href="#" class="div_typename" style="color: #0680ad;">栏目</a></span></span></div>
								<b></b>

						</li>

					</ul>
				</div>
		   </div>
		</div>
	</div>

	    		  <style>
  	.foot_img img {width:60px;}
	#category {display:none;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
</div>

<script>
  	$('#shop_skin_index').bind('touchmove', function(e){e.preventDefault()});
</script>
<?php }else if($template_id==24){?>
	<link  rel="stylesheet"  href="../common/fushi_24/css/style.css">
	<link  rel="stylesheet"  type="text/css"  href="../common/fushi_24/css/idangerous.swiper.css">
	<link  rel="stylesheet"  href="../common/fushi_24/css/header_style5.css">

    <link href="../common/fushi2/css/shop.css" rel="stylesheet" type="text/css">
    <link href="../common/fushi2/css/index.css" rel="stylesheet" type="text/css">
	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="shop_skin_index_list banner" rel="edit-t01">
			<div class="img" style="height: 100%;"><div class="slider" style="height: 100%;"><div class="flexslider" style="height: 100%;">
			<div class="flex-viewport" style="overflow: hidden; position: relative; height: 100%;">
			<ul class="slides" style="width: 800%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-1280px, 0, 0); height: 100%;">

			<li style="height: 100%; width: 640px; float: left; display: block;" class="">
			<a href="//#/api/0c2ecc2872/microbar/" style="height: 100%;">
			<img src="../common/fushi_23/images/banner.jpg" alt=""></a></li>
			</ul>
			</div></div></div></div>
		</div>

        <style>
		 @media all and (min-width:300px){
	  .slides img{height:570px!important;}
		}
		 @media all and (min-width:400px){
	  .slides img{height:736px!important;}
		}
		 @media all and (min-width:350px){
	  .slides img{height:667px!important;}
		}


    	.homeCnavbox ul li a{height:32px!important;}
    </style>
		 <div  id="index_m" style="top:120px">
		  <div  class="membersbox pad50">

				<div  class="homeCpay" style="top:150px;"><span class="shop_skin_index_list" rel="edit-t04"  no="3"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">栏目</a></span></span></div>
				<div  class="homeCmargin"></div>
				<div  class="homeCtitle"  style="color:#ffffff"><span class="shop_skin_index_list" rel="edit-t02"  no="1"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">栏目</a></span></span></div>
				<div  class="homeCcon"  style="color:#ffffff"><span class="shop_skin_index_list" rel="edit-t03"  no="2"><span class="text"><span  href="#" class="div_typename" style="color:#fff;">栏目</span></span></span></div>
				<div  class="homeCnav" style="position:fixed;bottom:0px;">
					<div  class="homeCnavbox swiper-container">
						<ul  class="swiper-wrapper"  style="width: 100%; height: 65px;">
							<li  class="swiper-slide"  style="width: 25%; height: 65px;">

									<div  class="shop_skin_index_list items"  rel="edit-t05"  no="4" style="width:31px;text-align:center;margin:0 auto;padding-top:5px;"><div  class="img"><img  src=""  width="31"  height="26"></div></div>
									<h2 style="margin-top:-9px;"><span class="shop_skin_index_list" rel="edit-t09"  no="8"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">栏目</a></span></span></h2>

							</li><li  class="swiper-slide"  style="width: 25%; height: 65px;">

									<div  class="shop_skin_index_list items"  rel="edit-t06"  no="5" style="width:31px;text-align:center;margin:0 auto;padding-top:5px;"><div  class="img"><img  src="fushi_24/images/index5-3.png"  width="31"  height="26"></div></div>
									<h2 style="margin-top:-9px;"><span class="shop_skin_index_list" rel="edit-t10"  no="9"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">栏目</a></span></span></h2>

							</li><li  class="swiper-slide"  style="width: 25%;height: 65px;">

									<div  class="shop_skin_index_list items"  rel="edit-t07"  no="6" style="width:31px;text-align:center;margin:0 auto;padding-top:5px;"><div  class="img"><img  src="fushi_24/images/index5-4.png"  width="31"  height="26"></div></div>
									<h2 style="margin-top:-9px;"><span class="shop_skin_index_list" rel="edit-t11"  no="10"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">栏目</a></span></span></h2>

							</li><li  class="swiper-slide"  style="width: 25%; height: 65px;">

									<div  class="shop_skin_index_list items"  rel="edit-t08"  no="7" style="width:31px;text-align:center;margin:0 auto;padding-top:5px;"><div  class="img"><img  src="fushi_24/images/index5-5.png"  width="31"  height="26"></div></div>
									<h2 style="margin-top:-9px;"><span class="shop_skin_index_list" rel="edit-t12"  no="11"><span class="text"><a  href="#" class="div_typename" style="color:#fff;">栏目</a></span></span></h2>

							</li>
						</ul>
					</div>
				</div>
			</div>


		</div>

   </div>


   		    		  <style>
  	.foot_img img {width:60px;}
		#category{display:none;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;position:relative;bottom:108px;z-index:999;height:0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>


</div>
<script>
  	$('#shop_skin_index').bind('touchmove', function(e){e.preventDefault()});
</script>
<?php }else if($template_id==25){?>

<link  rel="stylesheet"  href="../common/fushi_25/css/style.css">
<link  rel="stylesheet"  type="text/css"  href="../common/fushi_25/css/idangerous.swiper.css">
<link  rel="stylesheet"  href="../common/fushi_25/css/header_style6.css">

<link href="../common/fushi2/css/shop.css" rel="stylesheet" type="text/css">
<link href="../common/fushi2/css/index.css" rel="stylesheet" type="text/css">
<style>
#shop_skin_index .banner *{
	height:100%;
	#category {display:none;}
}
.mobile6_navbox ul li a{width:72px!important;height:72px!important;}
</style>
<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div  class="shop_skin_index_list banner"  rel="edit-t01"  no="0">
        <div  class="img"><img  src="fushi2/images/banner.jpg"></div>
	</div>
    <div  id="index_m" style="top:20px">
		<div  class="membersbox pad50">

			<div  class="mobile6_title"><span class="shop_skin_index_list" rel="edit-t02"  no="1"><a style="font-size:24px;" class="div_typename">大标题</a></span></div>
			<div  class="mobile6_con"><span class="shop_skin_index_list" rel="edit-t03"  no="2"><a class="div_typename">小标题</a></span></div>
			<div  class="mobile6_pay" style="top:140px;color:#fff"><span class="shop_skin_index_list"  rel="edit-t04"  no="3"><a class="div_typename">立即购买</a></span></div>
			<div  class="mobile6_margin"></div>

			<div  class="mobile6_nav" style="position:fixed;bottom:0px;">
				<div  class="mobile6_navbox swiper-container">
					<ul  class="swiper-wrapper">
						<li  class="swiper-slide " style="width:25%;">
							<span class="shop_skin_index_list"  rel="edit-t05"  no="4"><a class="div_typename">首页</a></span>
						</li>
						<li  class="swiper-slide " style="width:25%;">
							<span class="shop_skin_index_list"  rel="edit-t06"  no="5"><a class="div_typename">新品</a></span>
						</li>
						<li  class="swiper-slide " style="width:25%;">
							<span class="shop_skin_index_list"  rel="edit-t07"  no="6"><a class="div_typename">热卖</a></span>
						</li>
						<li  class="swiper-slide " style="width:25%;">
							<span class="shop_skin_index_list"  rel="edit-t08"  no="7"><a class="div_typename">促销</a></span>
						</li>
					</ul>
				</div>
			</div>
		</div>


    </div>

	   		    		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;position:relative;bottom:122px;z-index:999;height:0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>

</div>
<script>
var window_height=$(window).height();
$("#shop_skin_index").css("height",window_height+"px");

</script>

<?php }else if($template_id==26){?>

<style>
#shop_skin_index{background:#4b0c05}
.index-h img{width:60px!important;text-align:center;padding-left:5px;}
.index-h .img{width:100%;}
</style>
    <div  id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div  class="shop_skin_index_list logo"  rel="edit-t01">
			<div  class="img"><a  href="#">
			</a></div>
		</div>
		<div  class="search_box">
			 <!-- <form action="../../mshop/list.php?op=search&customer_id=<?php echo $customer_id; ?>" method="post">
				<input type="text" name="keyword" class="input" value="" placeholder="输入商品名称...">
				<input type="submit" class="submit" value=" ">
			</form> -->
			<input type="text" id="searchname" class="input" name="searchname" value="" placeholder="输入商品名称...">
			<input type="button" class="submit" onclick="search_name()" value=" ">
		 </div>
		<div  class="shop_skin_index_list banner"  rel="edit-t02">
			<div  class="img"><div  class="slider"><div  class="flexslider"><ul  class="slides"><li  style="display: list-item;"><a  href="//#/api/0c2ecc2872/shop/"><img  src="./商城_files/banner.jpg"  alt=""></a></li></ul></div></div></div>
		</div>
		<div  class="index-h">
			<div  class="shop_skin_index_list items"  rel="edit-t08"  no="7"><div  class="img"  ><a  href="#" onclick="goToOrderCart(<?php echo $from_type;?>)"></a></div></div>
		<div  class="shop_skin_index_list items"  rel="edit-t11"  no="10"><div  class="img"  ><a  href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>"></a></div></div>
		<div  class="shop_skin_index_list items"  rel="edit-t10"  no="9"><div  class="img"  ><a  href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>&isnew=1"></a></div></div>
		<div  class="shop_skin_index_list items"  rel="edit-t09"  no="8"><div  class="img"><a  href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"></a></div></div>
		</div>
		<div  class="ind_wrap">
			<div  class="ind_one_box">
				<div  class="lbar fl">
					<div  class="shop_skin_index_list"  rel="edit-t03"><div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div></div>
				</div>
				<div  class="rbar fr">
					<div  class="shop_skin_index_list"  rel="edit-t04"><div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div></div>
				</div>
				<div  class="clear"></div>
			</div>
			<div  class="ad_items"><div  class="shop_skin_index_list"  rel="edit-t05"><div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div></div></div>
					<div  class="products_list">

							<?php
							  $query = "select id,name from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
							  if(!empty($owner_typeids)){
							 //查找自己微店的产品
								 $query = $query." and (";
								 $owner_typeids_arr = explode(",",$owner_typeids);
								 $owner_typeids_count = count($owner_typeids_arr);
								 for($j=0;$j<$owner_typeids_count;$j++){
									 $o_typeid = $owner_typeids_arr[$j];
									 if($j==0){
										$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
									 }else{
										$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
									 }
								 }
								 $query = $query.")";
			                  }
			                  $query= $query." and ishot=1 limit 0,1";
							  $result = _mysql_query($query) or die('Query failed: ' . mysql_error());
							  while ($row = mysql_fetch_object($result)) {

							     $pid = $row->id;
								 $pname = $row->name;
							?>
							<div  class="items"><a  href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><?php echo $pname; ?></a></div>
							<?php } ?>
					  </div>
			<div  class="ad_items"><div  class="shop_skin_index_list"  rel="edit-t06"><div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div></div></div>
			<div  class="ad_items"><div  class="shop_skin_index_list"  rel="edit-t07"><div  class="img"><a  href="//#/api/0c2ecc2872/shop/"></a></div></div></div>
		</div>
	</div></div>
	<style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;margin-bottom:20px;padding:20px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div  id="footer_points"></div>
	<?php if($is_showbottom_menu){
	/*<footer  id="footer">
		<ul>
			<li  class="category"><a  href="javascript:;">全部分类</a></li>
			<li  class="cart"><a  href="order_cart.php?customer_id=<?php echo $customer_id_en;?>">购物车</a></li>
			<li  class="center"><a  href="index.php"><img  src="../common/huazhuang5_1/images/btm_home.png"></a></li>
			<li  class="hot"><a  href="../../mshop/list.php?ishot=1&customer_id=<?php echo $customer_id_en; ?>">热卖产品</a></li>
			<li  class="member"><a  href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">个人中心</a></li>
		</ul>
	</footer>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 } ?>
<?php }else if($template_id==27){?>


	<style>
.wenzi img{
	width: 40px;
	height: 40px;
	z-index: 999;
}
#shop_skin_index .banner *{
	height:100%;
}
</style>
	<div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="shop_skin_index_list banner" rel="edit-t01" no="0">
			<div class="img"></div>


		</div>

<script>
var window_height=$(window).height();
$("#shop_skin_index").css("height",window_height-70+"px");
</script>

<div class="main" id="main">

	<div class="music_div" style="padding-bottom: 18px;z-index:4">
		<table>
			<tbody>
				<tr>
					<td class="img_td"><a href=""> </a>
						<div class="music_img">
						<img id="img1" src="../common/fushi_27/images/gh.png" alt="" class="gh" style="z-index:333;"/>
						<a href="#" style="cursor: default; text-decoration: none;" >
						<div class="shop_skin_index_list" rel="edit-t02" no="1" style="float:none;height: 70px;">
						<div class="img wenzi" style="position: relative;top: 17px;left: 16px;"><img src="../common/fushi_27/images/wz1.png" /></div>
						</div>
						</a>
						</div>
					</td>
					<td class="img_td"><a href=""> </a>
						<div class="music_img">
						<img id="img2" src="../common/fushi_27/images/gh.png" alt="" class="gh" style="z-index:333"/>
						<a href="#" style="cursor: default; text-decoration: none;" >
						<div class="shop_skin_index_list" rel="edit-t03" no="2" style="float:none;height: 70px;">
						<div class="img wenzi" style="position: relative;top: 17px;left: 16px;"><img src="../common/fushi_27/images/wz2.png" /></div>
						</div>
						</a>
						</div>
					</td>
					<td class="img_td"><a href=""> </a>
						<div class="music_img">
						<img id="img3" src="../common/fushi_27/images/gh.png" alt="" class="gh" style="z-index:333"/>
						<a href="#" style="cursor: default; text-decoration: none;" >
						<div class="shop_skin_index_list" rel="edit-t04" no="3" style="float:none;height: 70px;">
						<div class="img wenzi" style="position: relative;top: 17px;left: 16px;"><img src="../common/fushi_27/images/wz3.png" /></div>
						</div>
						</a>
						</div>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
	<div  class="homeCnav" style="position:fixed;bottom:0px;">
		<div  class="homeCnavbox swiper-container" style="background-color: #4A0101;">
			<ul  class="swiper-wrapper"  style="width: 100%; height: 65px;">
				<li  class="swiper-slide"  style="width: 25%; height: 65px;">
					<a href="#"  >
							<div class="shop_skin_index_list" rel="edit-t05" no="4"  iscate="1" style="width:42px;text-align:center;margin:0 auto;padding-top:5px;height:42px">
								<div class="img"  style="background-size:100% 100%;"></div>
							</div>
						<div class="name shop_skin_index_list"  rel="edit-t09" no="8" >
							<div class="div_typename div_font" style="color:#FFFFFF" ></div>
						</div>
					</a>
				</li>
				<li  class="swiper-slide"  style="width: 25%; height: 65px;">
					<a href="#"  >
							<div class="shop_skin_index_list" rel="edit-t06" no="5"  iscate="1" style="width:42px;text-align:center;margin:0 auto;padding-top:5px;height:42px">
								<div class="img"  style="background-size:100% 100%;"></div>
							</div>
						<div class="name shop_skin_index_list"  rel="edit-t10" no="9" >
							<div class="div_typename div_font" style="color:#FFFFFF" ></div>
						</div>
					</a>
				</li>
				<li  class="swiper-slide"  style="width: 25%; height: 65px;">
					<a href="#"  >
							<div class="shop_skin_index_list" rel="edit-t07" no="6"  iscate="1" style="width:42px;text-align:center;margin:0 auto;padding-top:5px;height:42px">
								<div class="img"  style="background-size:100% 100%;"></div>
							</div>
						<div class="name shop_skin_index_list"  rel="edit-t11" no="10" >
							<div class="div_typename div_font" style="color:#FFFFFF" ></div>
						</div>
					</a>
				</li>
				<li  class="swiper-slide"  style="width: 25%; height: 65px;">
					<a href="#"  >
							<div class="shop_skin_index_list" rel="edit-t08" no="7"  iscate="1" style="width:42px;text-align:center;margin:0 auto;padding-top:5px;height:42px">
								<div class="img"  style="background-size:100% 100%;"></div>
							</div>
						<div class="name shop_skin_index_list"  rel="edit-t12" no="11" >
							<div class="div_typename div_font" style="color:#FFFFFF" ></div>
						</div>
					</a>
				</li>
			</ul>
		</div>
	</div>

   		    		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;position:relative;bottom:85px;z-index:3;height:0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <!--<?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>-->

                    <div style="text-align:center;width:100%;margin-top:58px;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
</div>

<?php }else if($template_id==28){?>

  <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
      <div class="header">
        <div class="search">
            <!-- <form action="../../mshop/list.php?op=search&customer_id=<?php echo $customer_id; ?>" method="post">
                <input type="text" name="keyword" class="input" value="" placeholder="输入商品名称...">
                <input type="submit" class="submit" value=" ">
            </form> -->
			<input type="text" id="searchname" class="input" name="searchname" value="" placeholder="输入商品名称...">
			<input type="button" class="submit" onclick="search_name()" value=" ">
        </div>
	  </div>
	  <div class="shop_skin_index_list banner" rel="edit-t01">
			<div class="img"><div class="slider"><div class="flexslider">
			<div class="flex-viewport" style="overflow: hidden; position: relative;">
			<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
			<li class="clone" style="width: 1263px; float: left; display: block;">
			<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>">
			</a></li>

			</ul>
			</div></div></div></div>
		</div>
		<div class="box">
			<ul>
				<li>
					<div class="shop_skin_index_list" rel="edit-t02">
						<div class="img">
						<a href="">

						</a></div>
					</div>
				</li>
				<li>
					<div class="shop_skin_index_list" rel="edit-t03">
						<div class="img"><a href="#">

						</a>
						</div>
					</div>
				</li>
				<li>
					<div class="shop_skin_index_list" rel="edit-t04">
						<div class="img">
						<a href="#">

						</a>
						</div>
					</div>
				</li>
				<li>
					<div class="shop_skin_index_list" rel="edit-t05">
						<div class="img"><a href="#">

						</a>
					  </div>
					</div>
				</li>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="shop_skin_index_list a0" rel="edit-t06">
			<div class="img"><a href="">

			</a></div>
		</div>
	</div>
	</div>
	<style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:none;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div id="footer_points"></div>
	<?php if($is_showbottom_menu){
    /*<footer id="footer">
	<ul>
		<li class="home"><a href="index.php?owner_id=<?php echo $owner_id; ?>"> 首页</a></li>
		<li class="category"><a href="javascript:;"> 分类</a></li>
		<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"> 个人中心</a></li>
		<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>"> 购物车</a></li>
	</ul>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 } ?>
 </footer>



<?php }else if($template_id==29){?>



 <div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div class="header" style="padding:0px;">
    	<div class="shop_skin_index_list banner"  rel="edit-t01" >
        	<div class="img" ><div class="slider"><div class="flexslider">
				<div class="flex-viewport" style="overflow: hidden; position: relative;">
					<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
						<li class="clone" style="width: 1263px;float: left; display: block;">
						<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>">
						</a></li>
					</ul>
				</div></div></div>
			</div>
        </div>
    </div>

<style>
.div_font {
	font-size:10px;
	color:#F64004;
}

.sd_color {
	background-color:#F74A11;
}
.head_div{
	margin-left:6px;
	margin-top:3px;
	<!-- background:red; -->
	padding:1px;
	position: absolute;
	z-index: 1;
	top: 120px;
	height: 74px;
	border-radius: 3px;
}
.headimgurl {
	width:74px;
	height:74px;
	border-radius: 3px;

}
</style>
    <div class="menu" style="padding:0px;background:#F9F9F9;">
    	<ul class="nav" style="float:right;">
        	<li style="width:49px;">
			 	<a href="#"  >
						<div class="shop_skin_index_list" rel="edit-t02" no="1"  iscate="1">
							<div class="img " style="background-size:30px 28px;margin:5px 10px 5px 10px;background-size:cover;height:30px;"></div>
						</div>
                    <div class="name shop_skin_index_list"  rel="edit-t07" no="6" >
						<div class="div_typename div_font" ></div>
					</div>
                </a>
            </li>
        	<li  style="width:49px;">
				<a href="#">
                	<div class="shop_skin_index_list" rel="edit-t03" no="2" iscate="1">
						<div class="img" style="background-size:30px 28px;margin:5px 10px 5px 10px;background-size:cover;height:30px;"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t08" no="7">
						<div class="div_typename div_font" ></div>
					</div>
				</a>
            </li>
        	<li style="width:49px;">
            	<a href="#" onclick="goToOrderCart(<?php echo $from_type;?>)">
                	<div class="shop_skin_index_list" rel="edit-t04" no="3"  iscate="1">
						<div class="img" style="background-size:31px 31px;margin:5px 10px 5px 10px;background-size:cover;height:30px;"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t09" no="8">
						<div class="div_typename div_font" ></div>
					</div>
                </a>
            </li>
        	<li style="width:49px;">
            	<a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">
                	<div class="shop_skin_index_list" rel="edit-t05" no="4" >
					  <div class="img " style="background-size:31px 31px;margin:5px 10px 5px 10px;background-size:cover;height:30px;"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t10" no="9" >
						<div class="div_typename div_font" ></div>
					</div>
                </a>
            </li>
			<li class="category" style="width:49px;" >
				<a href="javascript:;">
					<div   rel="edit-t06" no="5" >
						<div class="img"  style="background-size:31px 31px;overflow:hidden;backgroung:center center no-repeat no-repeat;margin:5px 10px 5px 10px;background-size:cover;height:30px;"></div>
					</div>
                    <div class="name shop_skin_index_list"  rel="edit-t11" no="10">
						<div class="div_typename div_font"></div>
					</div>
                </a>
            </li>
        </ul>
		<?php
				$query3="select weixin_headimgurl from weixin_users where isvalid=true and customer_id=".$customer_id ." and weixin_fromuser='".$fromuser."' order by id desc limit 0,1";
				$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
				   while ($row = mysql_fetch_object($result3)) {
						$headimgurl = $row->weixin_headimgurl;
				   }
				   if(!empty($headimgurl)){


			?>
		<div class="head_div">
			<img class="headimgurl" src="<?php echo $headimgurl; ?>">
		</div>
		<?php } ?>
		<div  class="clear"></div>


    </div>


		<div class="ind_wrap">
<?php
$query1="select id, name from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
if(!empty($owner_typeids)){
	$query1 = $query1." and id in (".$owner_typeids.")";
}
//$query1=$query1." order by id desc";

if($sort_str){
 $query1 =$query1.' order by field(id'.$sort_str.')';
 }

$result1 = _mysql_query($query1) or die('Query failed: ' . mysql_error());
while ($row = mysql_fetch_object($result1)) {
	$tid = $row->id;
	$tname = $row->name;

	//$query_q = "select id from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id." and type_id=".$tid;
	//$result_q = _mysql_query($query_q) or die('Query failed: ' . mysql_error());
	//$rcount_q2 = mysql_num_rows($result_q);
	//if(!empty($rcount_q2)){
	$type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
	$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
	while($row=mysql_fetch_object($result_typeson)){

		$typeson_id[]=$row->id;
		//$typeson_id1[]=$row->id;
	}
?>
	<div>
		<h3 style="color:#FFF;background-color:#303537;height:26px;font-size:14px;line-height: 26px;">
			<span  class="more" style="line-height:25px;" onclick="document.location='../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>';">		查看更多
			</span>
			<?php echo $tname ?>
		</h3>
		<div class="products">
			<?php
				//$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id." and type_id=".$tid;
				array_push($typeson_id,$tid);
				$typeson_id=implode(',',$typeson_id);
				//foreach($typeson_id as $arr){
					$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id."";
				if(empty($typeson_id)){
					$typeson_id=$tid;
				}
					$query = $query." and (";
					$typeson_id_arr = explode(",",$typeson_id);
					$typeson_id_count = count($typeson_id_arr);
					for($j=0;$j<$typeson_id_count;$j++){
						$o_typeid = $typeson_id_arr[$j];
						if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
							}else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						}
					}
					$query = $query.")";




				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
				}
				$query= $query." order by asort_value desc,id desc limit 0,4";
				//echo $query;
				$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
					while ($row = mysql_fetch_object($result)) {
						$pid = $row->id;
						$pname = $row->name;
						$orgin_price = $row->orgin_price;
						$now_price = $row->now_price;
						$p_img = $row->default_imgurl;
						$type_ids =$row->type_ids;
						$pro_discount=$row->pro_discount;


						if(empty($p_img)){
							$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
							$p_img = "";
							while ($row2 = mysql_fetch_object($result2)) {
							$p_img= $row2->imgurl;
							}
						 }

						/*if(!empty($type_ids)){
							$tid_arr = explode(",",$type_ids);
							$tlen = count($tid_arr);

							for($m=0;$m<$tlen;$m++){
								$tt_id = $tid_arr[$m];


								if($tt_id==$tid){*/
			?>
			<style>
				.pro_name{display:block;overflow:hidden;height:30px;line-height: 15px;}
			</style>
			<div  class="items" style="float:left;width:48%;height:100%;">
				<div class="pro_img" style="width:100%;height:100%;">
					<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
						<div class="img " >
							<img class="auto_img" src="<?php echo $new_baseurl.$p_img;?>">
						</div>
						<div class="pro_name"><?php echo $pname;?></div>
						<div style="float:right;background-color: #000;color: #fff;margin:0 3px 0 0;">
							<?php if($pro_discount!=0){echo ($pro_discount/10)."折";}?>
						</div>
						<div >
							<span style="color: #ff0000;font-size:15px;">
								<?php if(OOF_P != 2) echo OOF_S ?><?php echo $now_price;?><?php if(OOF_P == 2) echo OOF_S ?>
							</span>
							<span style="text-decoration: line-through;">
								<?php if(OOF_P != 2) echo OOF_S ?><?php echo $orgin_price;?><?php if(OOF_P == 2) echo OOF_S ?>
							</span>
						</div>
					</a>
				</div>
			</div>
			<?php
				/*				}
							}
						}*/
					//}
					}unset($typeson_id);
			?>
		</div>
		<div class="clear"></div>

	</div>
<?php
	//}
}
?>
<style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
</div>
    </div>

 <?php }else if($template_id==30){?>

  <div id="shop_skin_index"  <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
     <div class="header">
        <div class="shop_skin_index_list logo" rel="edit-t01">
            <div class="img"><a href=""></a></div>
        </div>
        <div class="search">
           <!--  <form action="../../mshop/list.php?op=search&customer_id=<?php echo $customer_id; ?>" method="post">
                <input type="text" name="keyword" class="input" value="" placeholder="输入商品名称...">
                <input type="submit" class="submit" value=" ">
            </form> -->
			<input type="text" id="searchname" class="input" name="searchname" value="" placeholder="输入商品名称...">
			<input type="button" class="submit" onclick="search_name()" value=" ">
        </div>
    </div>
    <div class="menu">
    	<ul>
        	<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t04" no="3"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t12" no="11">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
        	<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t05" no="4"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t13" no="12">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t06" no="5"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t14" no="13">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>

        	<li>
			 <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t07" no="6"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t15" no="14">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>



			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t08" no="7"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t16" no="15">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
        	<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t09" no="8"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t17" no="16">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t10" no="9"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t18" no="17">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>

        	<li>
			 <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t11" no="10"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t19" no="18">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>

        </ul>
        <div class="clear"></div>
    </div>
    <div class="box">
        <div class="shop_skin_index_list banner" rel="edit-t02">
            <div class="img"><div class="slider"><div class="flexslider">
				<div class="flex-viewport" style="overflow: hidden; position: relative;">
				<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
				<li class="clone" style="width: 1263px; float: left; display: block;">
				<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>">
				<img src="images/954b2f6396.jpg" alt=""></a></li>

				</ul>
				</div></div></div>
			</div>
        </div>
        <div class="blank3"></div>
		    <?php
		    $query = "select id,name,now_price,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
			if(!empty($owner_typeids)){
				 //查找自己微店的产品

					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			}
			$query= $query." order by asort_value desc,id desc limit 0,2";
			$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
	        while ($row = mysql_fetch_object($result)) {
			   $name = $row->name;
			   $pid = $row->id;
			   $now_price = $row->now_price;
			   $p_img = $row->default_imgurl;
			   if(empty($p_img)){
				   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
				   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
				   $p_img = "";
				   while ($row2 = mysql_fetch_object($result2)) {
					  $p_img= $row2->imgurl;
				   }
			   }

		 ?>
		     <div class="item">
                <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                    <div class="img"><img src="<?php echo $new_baseurl.$p_img; ?>"></div>
					<strong><?php echo $name; ?></strong>
					<span>
					<?php if(OOF_P != 2) echo OOF_S ?>
					<?php echo $now_price; ?>
					<?php if(OOF_P == 2) echo OOF_S ?>
					</span>
                </a>
            </div>
		<?php } ?>

        <div class="clear"></div>
        <div class="shop_skin_index_list a0" rel="edit-t03">
            <div class="img" style="height:168px;"><a href="#"></a></div>
        </div>
        <div class="a1">
		          <?php
				$query = "select id,name,now_price,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			   }
			   $query= $query." order by asort_value desc,id desc limit 2,4";

                $i=1;
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;
				   $now_price=$row->now_price;
				   $p_img = $row->default_imgurl;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }

		       ?>
        	   <div class="item">
                    <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                        <div class="img"><img src="<?php echo $new_baseurl.$p_img; ?>"></div>
                        <strong><?php echo $name; ?></strong>
                        <span>
						<?php if(OOF_P != 2) echo OOF_S ?>
						<?php echo $now_price; ?>
						<?php if(OOF_P == 2) echo OOF_S ?>
						</span>
                    </a>
                </div>
			<?php
		           if(fmod($i,2)==0){
				      echo "<div class=\"clear\"></div>";
				   }

		           $i++;
		     }
            ?>
		</div>
		<div class="clear"></div>
		 <?php
				$query = "select id,name,now_price,default_imgurl from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			   }
			   $query= $query." order by asort_value desc,id desc limit 4,50";
                $i=1;
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;
				   $now_price=$row->now_price;
				   $p_img = $row->default_imgurl;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }

		       ?>
        	   <div class="item">
                    <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                        <div class="img"><img src="<?php echo $new_baseurl.$p_img; ?>"></div>
                        <strong><?php echo $name; ?></strong>
                        <span>
						<?php if(OOF_P != 2) echo OOF_S ?>
						<?php echo $now_price; ?>
						<?php if(OOF_P == 2) echo OOF_S ?>
						</span>
                    </a>
                </div>
			<?php } ?>
	  </div>
	</div>
	</div>
	<style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
	<div id="footer_points"></div>
	<?php if($is_showbottom_menu){
   /*<footer id="footer">
	<ul>
		<li class="home"><a href="index.php"><img src="images/nav-0.jpg"> 首页</a></li>
		<li class="category"><a href="javascript:;"><img src="images/nav-1.jpg"> 分类</a></li>
		<li class="member"><a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"><img src="images/nav-2.jpg"> 个人中心</a></li>
		<li class="cart"><a href="../../mshop/order_cart.php?customer_id=<?php echo $customer_id_en;?>"><img src="images/nav-3.jpg"> 购物车</a></li>
	</ul>
   </footer>*/
   /*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
    } ?>

<?php }else if($template_id==31){?>
<style>
#bottom_footer{position:fixed;z-index:1000;bottom:0;background:#f9f9f9;width:100%;height:50px;border-top:2px solid #c9c9c9;box-sizing:border-box;}
#bottom_footer div .foot{float:left;text-align:center;height:50px;line-height:50px;}
.arrow_weixin{background: url("./images/textmenuicon.png") no-repeat scroll 0 0;width:15px;height: 15px;background-size: 15px 15px;font-size: 14px;line-height: 45px;display: inline-block;vertical-align: middle;}
.submenu{position:absolute;padding:5px 8px;background:#eaeaea;text-align:center;border-radius:5px;font-size:14px;line-height:41px;z-index:11;background-color:#fafafa;bottom:56px;border:1px solid #ccc;}
.arrow{position: absolute;z-index: 11;border-right: 6px solid transparent;border-left: 6px solid transparent;border-bottom:0px none;}
.line-divide{border-top: 2px solid #e5e5e5;}
#bottom_footer .wid a:hover{text-decoration:none;color:#333;}
</style>

<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="shop_skin_index_list" id="firpic" rel="edit-t01" no="0" style="width:100%;">
			<div class="img"></div>
			<div class="mod" style="display: none;">&nbsp;</div>

		</div>
		<div class="title shop_skin_index_list" rel="edit-t02" no="1" >
			<div class="div_typename"></div>
		</div>
		<div class="menu coupon">
			<ul>
				<li>
				   <a class="cp" href="" style="cursor: default; text-decoration: none;" >
					<div class="shop_skin_index_list coupon_price" rel="edit-t03" no="2" style="float:none;">
					<div class="div_typename" style="color:#fff;font-size:20px;"></div>
					</div>
					<div class="coupon_desc shop_skin_index_list" rel="edit-t04" no="3" style="float:none;">
						<div class="div_typename" style="color:#D53A49;"></div>
					</div>
					<div class="coupon_pic shop_skin_index_list" rel="edit-t19" no="18">
						<div class="img"></div>
						<div class="mod" style="display: none;">&nbsp;</div>
					</div>
					</a>
				</li>
				<li>
				   <a class="cp" href="" style="cursor: default; text-decoration: none;" >
					<div class="shop_skin_index_list coupon_price" rel="edit-t06" no="5" style="float:none;">
					<div class="div_typename" style="color:#fff;font-size:20px;"></div>
					</div>
					<div class="coupon_desc shop_skin_index_list" rel="edit-t07" no="6" style="float:none;">
						<div class="div_typename" style="color:#FF9900;"></div>
					</div>
					<div class="coupon_pic shop_skin_index_list" rel="edit-t20" no="19">
						<div class="img"></div>
						<div class="mod" style="display: none;">&nbsp;</div>
					</div>
					</a>
				</li>
				<li>
				   <a class="cp" href="" style="cursor: default; text-decoration: none;" >
					<div class="shop_skin_index_list coupon_price" rel="edit-t09" no="8" style="float:none;">
					<div class="div_typename" style="color:#fff;font-size:20px;"></div>
					</div>
					<div class="coupon_desc shop_skin_index_list" rel="edit-t10" no="9" style="float:none;">
						<div class="div_typename" style="color:#79A003;"></div>
					</div>
					<div class="coupon_pic shop_skin_index_list" rel="edit-t21" no="20">
						<div class="img"></div>
						<div class="mod" style="display: none;">&nbsp;</div>
					</div>
					</a>
				</li>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="notice shop_skin_index_list " rel="edit-t12" no="11" >
			<div class="div_typename js-scroll-notice notice"></div>
		</div>
		<div>
			<div class="shop_skin_index_list i0" rel="edit-t13" no="12">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i0" rel="edit-t14" no="13">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i0" rel="edit-t15" no="14">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i0" rel="edit-t16" no="15">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
		</div>
		<div class="shop_skin_index_list banner" id="banpic" rel="edit-t17" no="16" >
			<div class="img"><div class="slider">
			<div class="flexslider">
			<div class="flex-viewport" style="overflow: hidden; position: relative;">
			<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-2526px, 0, 0);"><li class="clone" style="width: 1263px; float: left; display: block;"><a href="#/api/c209e836af/shop/products/2066/">
			</a></li></ul></div></div></div></div>
		</div>
		<script>
			$(document).ready(function(){
				var window_width=$(window).width();
				$(".pro_img img").css("width",window_width/2.17+"px");
				$(".pro_img img").css("height",window_width/2.17+"px")
			})
		</script>
		<div class="box">
			<ul>
			<?php

			$query="select id,index_imgurl,name,imgurl from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
		   if(!empty($owner_typeids)){
		      $query = $query." and id in (".$owner_typeids.")";
		   }
		   $query=$query." order by id desc";
		   $result = _mysql_query($query) or die('Query failed: ' . mysql_error());
		   while ($row = mysql_fetch_object($result)) {
			  $tid = $row->id;
			  $tname = $row->name;
			  $index_imgurl = $row->index_imgurl;

				$type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
				$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
				while($row=mysql_fetch_object($result_typeson)){

					$typeson_id[]=$row->id;
					//$typeson_id1[]=$row->id;
				}

			   if(!empty($index_imgurl)){
			?>
				<li>
					<?php if($index_imgurl==""){?>
					<div class="shop_skin_index_list content" rel="edit-t18" no="17">
						<div class="img"></div><span onclick="document.location='../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>';"><?php echo $tname; ?></span>
					</div>
					<?php }else{?>
					<div class="shop_skin_index_list content" style="">
						<div class="img"><a onclick="document.location='../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>';"><img src="<?php echo $new_baseurl.$index_imgurl;?>"></a></div>
					</div>
					<?php }?>
					<div  class="products">

					<?php
							array_push($typeson_id,$tid);
							$typeson_id=implode(',',$typeson_id);
							$query1 = "select id,orgin_price,now_price,default_imgurl,type_ids from weixin_commonshop_products where  isvalid=true and isout=0 and customer_id=".$customer_id;

							if(empty($typeson_id)){
								$typeson_id=$tid;
							}
								$query1 = $query1." and (";
								$typeson_id_arr = explode(",",$typeson_id);
								$typeson_id_count = count($typeson_id_arr);
								for($j=0;$j<$typeson_id_count;$j++){
									$o_typeid = $typeson_id_arr[$j];
									if($j==0){
										$query1 = $query1."(LOCATE(',".$o_typeid.",', type_ids)>0)";
										}else{
										$query1 = $query1." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
									}
								}
								$query1 = $query1.")";
							if(!empty($owner_typeids)){
							 //查找自己微店的产品
								 $query1 = $query1." and (";
								 $owner_typeids_arr = explode(",",$owner_typeids);
								 $owner_typeids_count = count($owner_typeids_arr);
								 for($j=0;$j<$owner_typeids_count;$j++){
									 $o_typeid = $owner_typeids_arr[$j];
									 if($j==0){
										$query1 = $query1."(LOCATE(',".$o_typeid.",', type_ids)>0)";
									 }else{
										$query1 = $query1." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
									 }
								 }
								 $query1 = $query1.")";
							}
							$result1 = _mysql_query($query1) or die('Query failed2: ' . mysql_error());
							while ($row = mysql_fetch_object($result1)) {
								$pid = $row->id;
								$orgin_price = $row->orgin_price;
								$now_price = $row->now_price;
								$p_img = $row->default_imgurl;
								$type_ids =$row->type_ids;
							if(empty($p_img)){
							    $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							    $result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
							    $p_img = "";
							    while ($row2 = mysql_fetch_object($result2)) {
								$p_img= $row2->imgurl;
								}
							 }

					?>
									<div  class="items" style="float:left;width:46%;height:100%;margin:1% 2% 1% 2%">
										<div  class="pro_img" id="propic" style="width:100%;height:100%;"><a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><div class="img " ><img class="auto_img" src="<?php echo $new_baseurl.$p_img;?>"></div><div style="float:left;" ><span class="now_prices" style="color:#ff495b;">
										<?php if(OOF_P != 2) echo OOF_S ?>
										<?php echo $now_price;?>
										<?php if(OOF_P == 2) echo OOF_S ?>
										</span></br> <span class="orgin_prices">原价：
										<?php if(OOF_P != 2) echo OOF_S ?>
										<?php echo $orgin_price;?>
										<?php if(OOF_P == 2) echo OOF_S ?>
										</span>
										</div><div class="goods-buy">我要抢购</div>
										</a></div>
									</div>
					<?php

						}
					?>
				</div>
				</li>

			<?php }unset($typeson_id); } ?>
			</ul>
		</div>

			<div id="footer_points"></div>
							<style>
  	.foot_img img {width:60px;}
	#footer_points{height:0px!important;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;margin-bottom:50px;padding-bottom:25px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
			<?php if($is_showbottom_menu){
				/*<footer id="bottom_footer">
				<div>
					<div class="home foot" style="width:16%;border-right:1px solid #ccc;">
						<a href="index.php" style="background:#F9F9F9;"><img src="images/ico_home.png" style="width: 30px;height:30px;margin-top:10px;"></a>
					</div>
					<?php
						$result=_mysql_query("select count(1) as ccount from weixin_commonshop_userdefined_nav where isvalid=true and customer_id=".$customer_id) or die('Query failed_nav1:'.mysql_error());
						while($row=mysql_fetch_object($result)){
							$ccount=$row->ccount;
						}
						$j=1;
						$chk_submenu=0;
						$result=_mysql_query("select name,chk_submenu,navigation_link,subpros,sublinks from weixin_commonshop_userdefined_nav where isvalid=true and customer_id=".$customer_id) or die('Query failed_nav1:'.mysql_error());
						while($row=mysql_fetch_object($result)){
							$name=$row->name;
							$chk_submenu=$row->chk_submenu;
							$navigation_link=$row->navigation_link;
							$subpros=$row->subpros;
							$sublinks=$row->sublinks;

						$pro_separate=explode("#",$subpros);
						$links_separate=explode("#",$sublinks);
						$count=count($pro_separate);
						if($j!=$ccount){
					?>
					<div class="foot wid" style="border-right:1px solid #ccc;">
						<a href="<?php echo $navigation_link?$navigation_link:"##";?>"><i class="arrow_weixin"></i><span><?php echo $name;?></span>
						</a>
						<?php if($chk_submenu==1){ ?>
						<!--子菜单-->
						<div class="submenu" style="display:none;">
							<span class="arrow" style="right:auto;border-top:6px solid #ccc;bottom: -6px;"></span>
							<span class="arrow" style="right:auto;border-top:6px solid #fafafa;bottom: -5px;"></span>
							<ul>
							<?php for($i=1;$i<=$count;$i++){
							?>
								<li>
                                    <a href="<?php echo $links_separate[$i-1];?>"><?php echo $pro_separate[$i-1];?></a>
                                </li>
								<?php if($i!=$count){ ?><li class="line-divide"></li><?php } ?>
							<?php  } ?>
							</ul>
						</div>
						<?php } ?>
					</div>
						<?php }else{ ?>
							<div class="foot wid" >
								<a href="<?php echo $navigation_link?$navigation_link:"##";?>"><i class="arrow_weixin"></i><span><?php echo $name;?></span>
								</a>
								<?php if($chk_submenu==1){ ?>
								<!--子菜单-->
								<div class="submenu" style="display:none;">
									<span class="arrow" style="right:auto;border-top:6px solid #ccc;bottom: -6px;"></span>
									<span class="arrow" style="right:auto;border-top:6px solid #fafafa;bottom: -5px;"></span>
									<ul>
									<?php for($i=1;$i<=$count;$i++){?>
										<li>
											<a href="<?php echo $links_separate[$i-1];?>"><?php echo $pro_separate[$i-1];?></a>
										</li>
										<?php if($i!=$count){ ?><li class="line-divide"></li><?php } ?>
									<?php  } ?>
									</ul>
								</div>
								<?php } ?>
							</div>
						<?php } $j++;} ?>
				</div>
			   </footer>*/
			   /*判断是否显示底部菜单 start*/
				require_once('../../common/utility_setting_function.php');
				$fun = "index";
				$is_publish = check_is_publish(2,$fun,$customer_id);

				if($is_publish){
					require_once('../../mshop/bottom_label.php');
				}
				/*判断是否显示底部菜单 end*/
		    } ?>

	</div>


<script>
$(document).ready(function(){
	var submenu_count=<?php echo $ccount;?>;
	var foot_width=(81/submenu_count)+"%";
	$('.wid').width(foot_width);
})
$('.foot').click(function(){
	var foot_w=$(this).width();
	//var foot_c=(foot_w-16)/2
	$(this).children('div').width(foot_w-16);
	$(this).children('div').children(".arrow").css("left",((foot_w-16)/2)+"px");
	$(this).children('div').toggle();
	$(this).siblings().children('div').hide();
})
		var e = $(".js-scroll-notice");
		e.length && e.each(function() {
		function e() {
			i--, 0 > i + t && (i = o), n.css({
				left: i
			})
		}
		var n = $(this),
			t = n.width(),
			o = t,
			i = 0;
		 n.css({
			position: "relative"
		}), setInterval(e, 25)
	})

var window_width=$(window).width();
var fir_width=window_width/2.5;
$("#firpic").css("height",fir_width);
var ban_width=window_width/2;
$("#banpic").css("height",ban_width);
var propic_width=$("#propic").width();
var propic=propic_width/1.5;
$("#propic").css("height",propic);
</script>



<?php }else if($template_id==32){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div class="header" style="padding:0px;">
    	<div class="shop_skin_index_list banner"  rel="edit-t01" >
        	<div class="img" ><div class="slider"><div class="flexslider">
				<div class="flex-viewport" style="overflow: hidden; position: relative;">
					<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
						<li class="clone" style="width: 1263px;float: left; display: block;">
							<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>"></a>
						</li>
					</ul>
				</div></div></div>
			</div>
        </div>
    </div>
	<style>
.div_font {
	font-size:10px;
	color:#F64004;
}

.sd_color {
	background-color:#F74A11;
}
.head_div{
	margin-left:6px;
	margin-top:3px;
	<!-- background:red; -->
	padding:1px;
	position: absolute;
	z-index: 1;
	top: 120px;
	height: 74px;
	border-radius: 3px;
}
.headimgurl {
	width:74px;
	height:74px;
	border-radius: 3px;

}
</style>
    <div class="menu" style="padding:0px;background:#F9F9F9;">
    	<ul class="nav" style="float:right;">
        	<li style="width:49px;">
			 	<a href="#"  >
						<div class="shop_skin_index_list" rel="edit-t02" no="1"  iscate="1">
							<div class="img " style="background-size:80% 80%;"></div>
						</div>
                    <div class="name shop_skin_index_list"  rel="edit-t07" no="6" >
						<div class="div_typename div_font" ></div>
					</div>
                </a>
            </li>
        	<li  style="width:49px;">
				<a href="#">
                	<div class="shop_skin_index_list" rel="edit-t03" no="2" iscate="1">
						<div class="img" style="background-size:80% 80%;"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t08" no="7">
						<div class="div_typename div_font" ></div>
					</div>
				</a>
            </li>
        	<li style="width:49px;">
            	<a href="#" onclick="goToOrderCart(<?php echo $from_type;?>)">
                	<div class="shop_skin_index_list" rel="edit-t04" no="3"  iscate="1">
						<div class="img " style="background-size:80% 80%;"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t09" no="8">
						<div class="div_typename div_font" ></div>
					</div>
                </a>
            </li>
        	<li style="width:49px;">
            	<a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>">
                	<div class="shop_skin_index_list" rel="edit-t05" no="4" iscate="1">
					  <div class="img " style="background-size:80% 80%;"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t10" no="9" >
						<div class="div_typename div_font" ></div>
					</div>
                </a>
            </li>
			<li class="category" style="width:49px;" >
				<a href="javascript:;">
					<div  class="shop_skin_index_list" rel="edit-t06" no="5" iscate="1">
						<div class="img" style="background-size:80% 80%;"></div>
					</div>
                    <div class="name shop_skin_index_list"  rel="edit-t11" no="10">
						<div class="div_typename div_font"></div>
					</div>
                </a>
            </li>
        </ul>
		<?php
				$query3="select weixin_headimgurl from weixin_users where isvalid=true and customer_id=".$customer_id ." and weixin_fromuser='".$fromuser."' order by id desc limit 0,1";
				$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
				   while ($row = mysql_fetch_object($result3)) {
						$headimgurl = $row->weixin_headimgurl;
				   }
				   if(!empty($headimgurl)){


			?>
		<div class="head_div">
			<img class="headimgurl" src="<?php echo $headimgurl; ?>">
		</div>
		<?php } ?>
		<div  class="clear"></div>


    </div>
	<div  class="ind_wrap">

		  <?php

		   $query1="select id, name from weixin_commonshop_types where isvalid=true and is_shelves=1 and customer_id=".$customer_id." and parent_id=-1";
		   if(!empty($owner_typeids)){
		      $query1 = $query1." and id in (".$owner_typeids.")";
		   }
		   //$query1=$query1." order by id desc";

			if($sort_str){
			 $query1 =$query1.' order by field(id'.$sort_str.')';
			 }


		   //$query= $query." limit 0,5";
		   $result1 = _mysql_query($query1) or die('Query failed: ' . mysql_error());
		   $i=1;
		   while ($row = mysql_fetch_object($result1)) {
				$tid = $row->id;
				$tname = $row->name;

				$type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
				$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
				while($row=mysql_fetch_object($result_typeson)){

					$typeson_id[]=$row->id;
					//$typeson_id1[]=$row->id;
				}


			 // $query_q = "select id from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id." and type_id=".$tid;
			//	$result_q = _mysql_query($query_q) or die('Query failed: ' . mysql_error());
			//	$rcount_q2 = mysql_num_rows($result_q);
			//	if(!empty($rcount_q2)){
		?>
		   	<div>

				<h3 style="color:#FFF;background-color:#303537;height:26px;font-size:14px;line-height: 26px;"><span  class="more" style="line-height:25px;" onclick="document.location='../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>';">查看更多</span><?php echo $tname ?></h3>
				<div  class="products">

					<?php

						array_push($typeson_id, $tid);
						$typeson_id=implode(',',$typeson_id);
						$i =0;
						//foreach($typeson_id as $arr){
							$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
							//$query = $query." and LOCATE('".$arr."', type_ids)>0";
							//	$query= $query." and type_id=".$tid;
							if(empty($typeson_id)){
								$typeson_id=$tid;
							}
								$query = $query." and (";
								$typeson_id_arr = explode(",",$typeson_id);
								$typeson_id_count = count($typeson_id_arr);
								for($j=0;$j<$typeson_id_count;$j++){
									$o_typeid = $typeson_id_arr[$j];
									if($j==0){
										$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
										}else{
										$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
									}
								}
								$query = $query.")";


							$query= $query." order by asort_value desc,id desc limit 0,3";
							//echo $query;

							$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
							while ($row = mysql_fetch_object($result)) {
								$i++;
								$pid = $row->id;
								$pname = $row->name;
								$orgin_price = $row->orgin_price;
								$now_price = $row->now_price;
								$p_img = $row->default_imgurl;
								$type_ids =$row->type_ids;
								$pro_discount=$row->pro_discount;


							if(empty($p_img)){
							    $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							    $result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
							    $p_img = "";
							    while ($row2 = mysql_fetch_object($result2)) {
								$p_img= $row2->imgurl;
								}
							 }

							//if(!empty($type_ids)){
							//	$tid_arr = explode(",",$type_ids);
							//	$tlen = count($tid_arr);
							//
							//	for($m=0;$m<$tlen;$m++){
							//		$tt_id = $tid_arr[$m];
							//		if($tt_id==$tid){
							if($i<4){
					?>
									<div  class="items items_<?php echo $i;?>">
										<div  class="pro_img">
											<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
												<div class="img" >
													<img class="auto_img" style="height:100%;" src="<?php echo $new_baseurl.$p_img;?>">
												</div>
											</a>
										</div>
									</div>
					<?php
							//	}}
						//	}
							//}
						}}
						unset($typeson_id);
					?>

				</div>
				<div class="clear"></div>

			</div>

		<?php
			//}
		}
		?>
		<script>
var products = $(".products")
var products_items = $(".products .items_1");
var items_1_width = products_items.width();
var items_1_height = items_1_width/2;
products_items.css("height",items_1_height+"px");

var products_items2 = $(".products .items_2");
var products_items3 = $(".products .items_3");
var items_2_width = products_items2.width();
var items_2_height = items_2_width*2/3;
products_items2.css("height",items_2_height+"px");
products_items3.css("height",items_2_height+"px");
</script>

		</div>
			  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
</div>


<?php }else if($template_id==33){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div class="header" style="padding:0px;">
    	<div class="shop_skin_index_list banner"  rel="edit-t01" >
        	<div class="img" ><div class="slider"><div class="flexslider">
				<div class="flex-viewport" style="overflow: hidden; position: relative;">
					<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
						<li class="clone" style="width: 1263px;float: left; display: block;">
							<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>"></a>
						</li>
					</ul>
				</div></div></div>
			</div>
        </div>
    </div>
	<style>
.div_font {
	font-size:10px;
	color:#F64004;
}

.sd_color {
	background-color:#F74A11;
}
.head_div{
	margin-left:6px;
	margin-top:3px;
	<!-- background:red; -->
	padding:1px;
	position: absolute;
	z-index: 1;
	top: 120px;
	height: 74px;
	border-radius: 3px;
}
.headimgurl {
	width:74px;
	height:74px;
	border-radius: 3px;

}
.marquee{
height: 30px;
line-height: 30px;
font-size: 100%;
}
</style>
 	<div class="marquee shop_skin_index_list"  rel="edit-t18" no="17">
		<marquee scrollamount="2">
		<div class="div_typename r_color"></div>
		</marquee>
	</div>
    <div class="menu" style="padding:0px;background:#F9F9F9;">
    	<ul class="nav">
    		<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t02" no="1"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t10" no="9">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t03" no="2"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t11" no="10">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t04" no="3"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t12" no="11">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t05" no="4"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t13" no="12">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t06" no="5"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t14" no="13">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t07" no="6"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t15" no="14">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t08" no="7"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t16" no="15">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t09" no="8"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t17" no="16">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>

        </ul>

		<div  class="clear"></div>


    </div>
	<div  class="ind_wrap" style="margin-top: 5px;">

		  <?php

		   $query1="select id, name from weixin_commonshop_types where isvalid=true and is_shelves=1 and customer_id=".$customer_id;
		   if(!empty($owner_typeids)){
		      $query1 = $query1." and id in (".$owner_typeids.")";
		   }
		   //$query1=$query1." order by id desc";

			if($sort_str){
			 $query1 =$query1.' order by field(id'.$sort_str.')';
			 }

		   //$query= $query." limit 0,5";
		   $result1 = _mysql_query($query1) or die('Query failed: ' . mysql_error());
		   $i=1;
		   while ($row = mysql_fetch_object($result1)) {
			  $tid = $row->id;
			  $tname = $row->name;

			  $type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
				$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
				while($row=mysql_fetch_object($result_typeson)){

					$typeson_id[]=$row->id;
					//$typeson_id1[]=$row->id;
				}

			  $query_q = "select id from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id." and type_id=".$tid;
			$result_q = _mysql_query($query_q) or die('Query failed: ' . mysql_error());
			$rcount_q2 = mysql_num_rows($result_q);
			if(!empty($rcount_q2)){
		?>
		   	<div  >

				<h3 style="color:#FFF;background-color:#303537;height:26px;font-size:14px;line-height: 26px;"><span  class="more" style="line-height:25px;" onclick="document.location='../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>';">查看更多</span><?php echo $tname ?></h3>
				<div  class="products">

					<?php
							array_push($typeson_id,$tid);
							$typeson_id=implode(',',$typeson_id);
							$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;

							//	$query= $query." and type_id=".$tid;
							if(empty($typeson_id)){
								$typeson_id=$tid;
							}
								$query = $query." and (";
								$typeson_id_arr = explode(",",$typeson_id);
								$typeson_id_count = count($typeson_id_arr);
								for($j=0;$j<$typeson_id_count;$j++){
									$o_typeid = $typeson_id_arr[$j];
									if($j==0){
										$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
										}else{
										$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
									}
								}
								$query = $query.")";


							$i=0;
							$query= $query." order by asort_value desc,id desc limit 0,3";
							$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
							while ($row = mysql_fetch_object($result)) {
								$i++;
								$pid = $row->id;
								$pname = $row->name;
								$orgin_price = $row->orgin_price;
								$now_price = $row->now_price;
								$p_img = $row->default_imgurl;
								$type_ids =$row->type_ids;
								$pro_discount=$row->pro_discount;


							if(empty($p_img)){
							    $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							    $result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
							    $p_img = "";
							    while ($row2 = mysql_fetch_object($result2)) {
								$p_img= $row2->imgurl;
								}
							 }

							/* if(!empty($type_ids)){
								$tid_arr = explode(",",$type_ids);
								$tlen = count($tid_arr);

								for($m=0;$m<$tlen;$m++){
									$tt_id = $tid_arr[$m];


									if($tt_id==$tid){ */
					?>
									<div  class="items items_<?php echo $i;?>">
										<div  class="pro_img">
											<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
												<div class="img " >
													<img class="auto_img" style="height:100%;" src="<?php echo $new_baseurl.$p_img;?>">
												</div>
											</a>
										</div>
									</div>
					<?php
							//	}}
							//}
						}
					?>

				</div>
				<div class="clear"></div>

			</div>

		<?php
			}
			unset($typeson_id);
		}
		?>
<script>
var products = $(".products")
var products_items = $(".products .items_1");
var items_1_width = products_items.width();
var items_1_height = items_1_width/1.5*0.96;
products_items.css("height",items_1_height+"px");

var products_items2 = $(".products .items_2");
var products_items3 = $(".products .items_3");
var items_2_width = products_items2.width();
var items_2_height = items_2_width/1.5*0.96;
products_items2.css("height",items_2_height+"px");
products_items3.css("height",items_2_height+"px");
</script>

		</div>
		 <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>

</div>

<?php }else if($template_id==34){?>
<style>
.bg_img img{width:100%;height:100%;}
</style>
<script>
var window_width=$(window).width();
$("#bg_img img").css("width",window_width);
</script>

	<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
        <div class="shop_slider shop_slider_auto mod_pic_mt_1" >
            <div class="inner bg_img" id="bg_img" data-tag="slider-warp" style="visibility: visible;">
            	<div class="shop_skin_index_list banner"  rel="edit-t01" no="0">
                    <div class="img" >
                        <ul class="pic_list" data-tag="slider-list">
                            <li><a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>"></a></li>
                        </ul>
                    </div>
                </div>

            </div>
        </div>

        <?php //获取头像
			$query3="select weixin_headimgurl from weixin_users where isvalid=true and customer_id=".$customer_id ." and weixin_fromuser='".$fromuser."' order by id desc limit 0,1";
			$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
			while ($row = mysql_fetch_object($result3))
			{
				$headimgurl = $row->weixin_headimgurl;
			}
			if(!empty($headimgurl))
		?>
        <style>
        .div_font{font-size:12px;height:18px;}
		.iconjh-cart .img img{height:24px;}
        </style>

        <section class="members_head_nav">
            <section class="members_head_nav_le" style="z-index:999;"><img src="<?php echo $headimgurl; ?>" width="60" height="60"></section>
            <section class="members_head_nav_ri">
                <ul>
                	<?php

                		$query = "select count(1) as count from weixin_commonshop_products where isout=false and isvalid=true and customer_id=".$customer_id;
						if(!empty($owner_typeids)){
						 //查找自己微店的产品
							 $query = $query." and (";
							 $owner_typeids_arr = explode(",",$owner_typeids);
							 $owner_typeids_count = count($owner_typeids_arr);
							 for($j=0;$j<$owner_typeids_count;$j++){
								 $o_typeid = $owner_typeids_arr[$j];
								 if($j==0){
									$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
								 }else{
									$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
								 }
							 }
							 $query = $query.")";
						}
						$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
						while($row=mysql_fetch_object($result)){
							$count=$row->count;
							}

					?>

                    <li ><span><?php echo $count;?></span>
                        <div class="name shop_skin_index_list" rel="edit-t06" no="5">
                        	<div class="div_typename div_font" ></div>
                        </div>
                    </li>
                    <li >
                        <span class="iconjh-brand" >
                            <div class="shop_skin_index_list" rel="edit-t02" no="1" >

                            	<div class="img" style="height:24px;"></div>
                            </div>
                        </span>
                        <div class="name shop_skin_index_list" rel="edit-t07" no="6">
                        	<div class="div_typename div_font" ></div>
                        </div>
                    </li>
                    <li >
                        <span class="iconjh-cart" >
                            <div class="shop_skin_index_list" rel="edit-t03" no="2">
                            	<div class="img"></div>
                        	</div>
                        </span>
                        <div class="name shop_skin_index_list" rel="edit-t08" no="7">
                        	<div class="div_typename div_font" ></div>
                        </div>
                    </li>
                    <li>
                        <span class="iconjh-member" >
                            <div class="shop_skin_index_list" rel="edit-t04" no="3">
                            	<div class="img"></div>
                            </div>
                        </span>
                        <div class="name shop_skin_index_list" rel="edit-t09" no="8">
                        	<div class="div_typename div_font" ></div>
                        </div>
                    </li>
                     <li >
                        <span class="iconjh-member" >
                            <div class="shop_skin_index_list" rel="edit-t05" no="4">
                            	<div class="img"></div>
                            </div>
                        </span>
                        <div class="name shop_skin_index_list" rel="edit-t10" no="9">
                        	<div class="div_typename div_font" ></div>
                        </div>
                    </li>
                    <!--<li style="width:45px;">
                    <span class="iconjh-class" >
                    <div class="shop_skin_index_list" rel="edit-t05" no="4">
                    <div class="img"></div>
                    </div>
                    </span>

                    </li>
                    -->
                </ul>
            </section>
        </section>


        <div class="members_con">
            <section class="members_goodspic">
				<?php
                $query1="select id, name from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
                if(!empty($owner_typeids)){
                    $query1 = $query1." and id in (".$owner_typeids.")";
                }
				//$query1=$query1." order by id desc";

				if($sort_str){
				 $query1 =$query1.' order by field(id'.$sort_str.')';
				 }

                $result1 = _mysql_query($query1) or die('Query failed: ' . mysql_error());
				$typeson_id=array();
                while ($row = mysql_fetch_object($result1)) {
                    $tid = $row->id;
                    $tname = $row->name;

					$type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
					$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
					while($row=mysql_fetch_object($result_typeson)){

						$typeson_id[]=$row->id;
						//$typeson_id1[]=$row->id;
					}

                ?>
                <div class="pro_list_title">
                    <div class="left"><?php echo $tname; ?></div>
                    <div class="right"><a href="../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>">更多&gt;&gt;</a></div>
                </div>

                <ul>
                	<?php

					array_push($typeson_id,$tid);
					$typeson_id=implode(',',$typeson_id);

				$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id."";

				if(empty($typeson_id)){
					$typeson_id=$tid;
				}
					$query = $query." and (";
					$typeson_id_arr = explode(",",$typeson_id);
					$typeson_id_count = count($typeson_id_arr);
					for($j=0;$j<$typeson_id_count;$j++){
						$o_typeid = $typeson_id_arr[$j];
						if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
							}else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						}
					}
					$query = $query.")";


				//echo $query = $query." and LOCATE(type_id,'".$typeson_id."')>0";
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
				}
			 $query= $query." order by asort_value desc,id desc limit 0,20";

				//echo $query;
				$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
					while ($row = mysql_fetch_object($result)) {
						$pid = $row->id;
						$pname = $row->name;
						$orgin_price = $row->orgin_price;
						$now_price = $row->now_price;
						$p_img = $row->default_imgurl;
						$type_ids =$row->type_ids;
						$pro_discount=$row->pro_discount;
						$sell_count =$row->sell_count;
						$show_sell_count =$row->show_sell_count;

						if(empty($p_img)){
							$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
							$p_img = "";
							while ($row2 = mysql_fetch_object($result2)) {
							$p_img= $row2->imgurl;
							}
						 }


			?>
                    	 <li class="mingoods">
                           <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                              <img class="lazy" src="<?php echo $new_baseurl.$p_img;?>" data-original="<?php echo $new_baseurl.$p_img;?>" width="100%" style="display: inline;">
                           </a>
                           <span class="goods-title"><a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>" style="font-size:12px;display:block;overflow:hidden;height:18px;"><?php echo $pname;?></a></span>
                           <span class="price">
						   <?php if(OOF_P != 2) echo OOF_S ?>
						   <?php echo $now_price;?>
						   <?php if(OOF_P == 2) echo OOF_S ?>
						   </span>
                           <em style="padding-left:10px; font-size:10px; color:#999">已售：<?php echo $sell_count+$show_sell_count;?>笔</em>

                      </li>
                      <?php

					}
					unset($typeson_id);

					?>
                </ul>
                <?php


				}

				?>
            </section>
        </div> <!--产品分类结束-->
       <?php


			if($supportname){
		?>
        	<style>
				.foot_img1 img{width:60px!important;}
			</style>
			<div class="" style="width:100%;display:block;padding:18px 0px;float:left;">
            	<section class="members_goodspic" style="margin-top:0px!important;margin-bottom:50px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img foot_img1"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
        <?php if($is_showbottom_menu){
			/*<div class="fixed bottom"><!--底部固定栏-->
                <div class="distribution-tip" id="distribution-tip" style="display: none;"></div>
                    <dl class="sub-nav nav-b5">
                        <dd class="active">
                            <div class="nav-b5-relative shop_skin_index_list" rel="edit-t11" no="10"><i><div class="img"></div></i></div><div class="name shop_skin_index_list" rel="edit-t15" no="14">
                                <div class="div_typename div_font" ></div>
                            </div>
                        </dd>
                        <dd>
                            <div class="nav-b5-relative shop_skin_index_list" rel="edit-t12" no="11"><i><div class="img"></div></i></div><div class="name shop_skin_index_list" rel="edit-t16" no="15">
                                <div class="div_typename div_font" ></div>
                            </div>
                        </dd>
                        <dd>
                            <div class="nav-b5-relative shop_skin_index_list" rel="edit-t13" no="12"><i><div class="img"></div></i></div><div class="name shop_skin_index_list" rel="edit-t17" no="16">
                                <div class="div_typename div_font" ></div>
                            </div>
                        </dd>
                        <dd>
                            <div class="nav-b5-relative shop_skin_index_list" rel="edit-t14" no="13"><i><div class="img"></div></i></div><div class="name shop_skin_index_list" rel="edit-t18" no="17">
                                <div class="div_typename div_font" ></div>
                            </div>
                        </dd>
                    </dl>
			</div><!--底部结束-->*/
			/*判断是否显示底部菜单 start*/
			require_once('../../common/utility_setting_function.php');
			$fun = "index";
			$is_publish = check_is_publish(2,$fun,$customer_id);

			if($is_publish){
				require_once('../../mshop/bottom_label.php');
			}
			/*判断是否显示底部菜单 end*/
         }?>
            <div class="mask_menu" style="display:none;"></div>
            <div class="menu" id="menufloat"><!--<i class="icon-menu"></i>--><img src="../common/fengge34/css/images/menu.png"></div>
            <div class="menu-c  notel" id="menufloat-c" style="display:none;">
                <div class="menu-c-out">
                    <div class="menu-c-inner">
                        <a class="a-home" href="index.php" title="首页"></a>
                        <a class="a-tel" href="../../online/show_online.php?customer_id=<?php echo $customer_id_en; ?>" title="联系店主"></a>
                        <a class="a-server" href="../../online/show_online.php?customer_id=<?php echo $customer_id_en; ?>" title="客服"></a>
                        <a class="a-member" href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>" title="会员中心"></a>
                        <a class="a-search" href="../../mshop/list.php" title="搜索"></a>
                        <a class="a-cart" href="#" onclick="goToOrderCart(<?php echo $from_type;?>)" title="购物车"></a>
                        <a class="a-collect" href="../../mshop/list.php" id="collect-link" title="所有产品"></a>
                    </div>
            	</div>
            </div>



	</div>

<?php }else if($template_id==35){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div class="header" style="padding:0px;">
    	<div class="shop_skin_index_list banner"  rel="edit-t01" >
        	<div class="img" ><div class="slider"><div class="flexslider">
				<div class="flex-viewport" style="overflow: hidden; position: relative;">
					<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
						<li class="clone" style="width: 1263px;float: left; display: block;">
							<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>"></a>
						</li>
					</ul>
				</div></div></div>
			</div>
        </div>
    </div>
	<script>
	var window_width=$(window).width();
	var header =$(".header");
	var header_height =window_width/2;
	header.css("height",header_height+"px");
	</script>
 	<div class="marquee shop_skin_index_list"  rel="edit-t18" no="17">
		<marquee scrollamount="2">
		<div class="div_typename r_color"></div>
		</marquee>
	</div>
    <div class="menu" style="padding:0px;background:#F9F9F9;">
    	<ul class="nav">
    		<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t02" no="1"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t10" no="9">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t03" no="2"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t11" no="10">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t04" no="3"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t12" no="11">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t05" no="4"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t13" no="12">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t06" no="5"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t14" no="13">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t07" no="6"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t15" no="14">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t08" no="7"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t16" no="15">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>
			<li>
			   <a href="#" style="cursor: default; text-decoration: none;" >
                	<div class="shop_skin_index_list" rel="edit-t09" no="8"  iscate="1">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t17" no="16">
						<div class="div_typename r_color"></div>
					</div>
                </a>
			</li>

        </ul>

		<div  class="clear"></div>


    </div>
	<div  class="ind_wrap" style="margin-top: 5px;">

		  <?php

		   $query1="select id, name from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
		   if(!empty($owner_typeids)){
		      $query1 = $query1." and id in (".$owner_typeids.")";
		   }
		   //$query1=$query1." order by id desc";

			if($sort_str){
			 $query1 =$query1.' order by field(id'.$sort_str.')';
			 }

		   //$query= $query." limit 0,5";
		   $result1 = _mysql_query($query1) or die('Query failed: ' . mysql_error());
		   $i=1;
		   while ($row = mysql_fetch_object($result1)) {
			  $tid = $row->id;
			  $tname = $row->name;
			  $type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
			  $result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
			  while($row=mysql_fetch_object($result_typeson)){

				$typeson_id[]=$row->id;
				//$typeson_id1[]=$row->id;
			  }

		?>
		   	<div  >

				<h3 style="color:#FFF;background-color:#303537;height:26px;font-size:14px;line-height: 26px;"><span  class="more" style="line-height:25px;" onclick="document.location='../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>';">查看更多</span><?php echo $tname ?></h3>
				<div  class="products">

					<?php
							array_push($typeson_id,$tid);
							$typeson_id=implode(',',$typeson_id);
							$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;

							//$query= $query." and type_id=".$tid;
							if(empty($typeson_id)){
								$typeson_id=$tid;
							}
								$query = $query." and (";
								$typeson_id_arr = explode(",",$typeson_id);
								$typeson_id_count = count($typeson_id_arr);
								for($j=0;$j<$typeson_id_count;$j++){
									$o_typeid = $typeson_id_arr[$j];
									if($j==0){
										$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
										}else{
										$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
									}
								}
								$query = $query.")";


							$i = 0;
							$query= $query." order by asort_value desc,id desc limit 0,3";
							$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
							while ($row = mysql_fetch_object($result)) {
								$i++;
								$pid = $row->id;
								$pname = $row->name;
								$orgin_price = $row->orgin_price;
								$now_price = $row->now_price;
								$p_img = $row->default_imgurl;
								$type_ids =$row->type_ids;
								$pro_discount=$row->pro_discount;


							if(empty($p_img)){
							    $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							    $result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
							    $p_img = "";
							    while ($row2 = mysql_fetch_object($result2)) {
								$p_img= $row2->imgurl;
								}
							 }

							//if(!empty($type_ids)){
							//	$tid_arr = explode(",",$type_ids);
							//	$tlen = count($tid_arr);

							//	for($m=0;$m<$tlen;$m++){
							//		$tt_id = $tid_arr[$m];


							//		if($tt_id==$tid){
					?>
									<div  class="items items_<?php echo $i;?>">
										<div  class="pro_img">
											<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
												<div class="img " >
													<img class="auto_img" style="height:100%;" src="<?php echo $new_baseurl.$p_img;?>">
												</div>
											</a>
										</div>
									</div>
					<?php
							//}}
							//}
						}
					?>

				</div>
				<div class="clear"></div>

			</div>

		<?php

			unset($typeson_id);
		}
		?>
<script>
var products = $(".products")
var products_items = $(".products .items_1");
var items_1_width = products_items.width();
var items_1_height = items_1_width/2;
products_items.css("height",items_1_height+"px");

var products_items2 = $(".products .items_2");
var products_items3 = $(".products .items_3");
var items_2_width = products_items2.width();
var items_2_height = items_2_width/2;
products_items2.css("height",items_2_height+"px");
products_items3.css("height",items_2_height+"px");
</script>
		</div>
		 <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;padding-bottom:18px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
        <?php if($is_showbottom_menu){
		/*<div style="margin-bottom:55px;"></div>
		<div class="button_tab_menu">
			<table>
				<tbody>
					<tr>
						<td align="center" valign="middle" style="width: 19%;">
							<div class="footer_div">
								<a href="#">
									<div class="shop_skin_index_list" rel="edit-t19" no="18"  iscate="1">
										<div class="footer_tab_index_0 footer_icon footer_icon_0 img"></div>
									</div>
									<div class="name shop_skin_index_list" rel="edit-t23" no="22">
										<div class="r_color"><a  href="#" class="div_typename"></a></div>
									</div>
								</a>
							</div>
						</td>
						<td align="center" valign="middle" style="width: 19%;">
							<div class="footer_div">
								<a href="#">
									<div class="shop_skin_index_list" rel="edit-t20" no="19"  iscate="1">
										<div class="footer_tab_index_1 footer_icon footer_icon_1 img"></div>
									</div>
									<div class="name shop_skin_index_list" rel="edit-t24" no="23">
										<div class="r_color"><a  href="#" class="div_typename"></a></div>
									</div>
								</a>
							</div>
						</td>
						<td align="center" valign="middle" style="width: 24%;">
							<a style="width: 100%">
								<div id="logo" class="shop_skin_index_list" style="position:absolute;" rel="edit-t27" no="26">
								<center>
									<div id="divuserheader" class="footer_tab_index_2 footer_icon footer_icon_2 img"></div>
								</center>
								</div>&nbsp;
							</a>
						</td>
						<td align="center" valign="middle" style="width: 19%;">
							<div class="footer_div">
								<a href="#">
									<div class="shop_skin_index_list" rel="edit-t21" no="20"  iscate="1">
										<div class="footer_tab_index_2 footer_icon footer_icon_2 img"></div>
									</div>
									<div class="name shop_skin_index_list" rel="edit-t25" no="24">
										<div class="r_color"><a  href="#" class="div_typename"></a></div>
									</div>
								</a>
							</div>
						</td>
						<td align="center" valign="middle" style="width: 19%;">
							<div class="footer_div">
								<a href="#">
									<div class="shop_skin_index_list" rel="edit-t22" no="21"  iscate="1">
										<div class="footer_tab_index_3 footer_icon footer_icon_3 img"></div>
									</div>
									<div class="name shop_skin_index_list" rel="edit-t26" no="25">
										<div class="r_color"><a  href="#" class="div_typename"></a></div>
									</div>
								</a>
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>*/
		/*判断是否显示底部菜单 start*/
		require_once('../../common/utility_setting_function.php');
		$fun = "index";
		$is_publish = check_is_publish(2,$fun,$customer_id);

		if($is_publish){
			require_once('../../mshop/bottom_label.php');
		}
		/*判断是否显示底部菜单 end*/
		 }?>
</div>

<?php }else if($template_id==36){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div class="header" style="padding:0px;">
    	<div class="shop_skin_index_list banner"  rel="edit-t01" >
        	<div class="img" ><div class="slider"><div class="flexslider">
				<div class="flex-viewport" style="overflow: hidden; position: relative;">
					<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
						<li class="clone" style="float: left; display: block;">
							<a href="../../mshop/list.php?customer_id=<?php echo $customer_id; ?>"></a>
						</li>
					</ul>
				</div></div></div>
			</div>
        </div>
    </div>
	<script>
	var window_height=$(window).width();
	var header =$(".header");
	var header_height =window_height/2;
	header.css("height",header_height+"px");
	</script>
 	<div class="marquee shop_skin_index_list"  rel="edit-t18" no="17">
		<marquee scrollamount="2">
		<div class="div_typename r_color"></div>
		</marquee>
	</div>
    <div id="app-field-model-page-1" style="width:100%">
    	<style>
        .app-preview-anmin .img{max-width:200px;margin:0 auto;width:42%;}
        </style>
        <div class="app-field clearfix clearfix_list b_white app-preview-anmin"><!--icon开始-->
            <div style="height: 10px;"></div>

            <div style="width:25%;float:left;text-align:center;">
              <div class="shop_skin_index_list" rel="edit-t02" no="1">
                  <div class="img"></div>
              </div>
               <div class="name shop_skin_index_list" rel="edit-t10" no="10">
                  <div class="div_typename r_color"></div>
              </div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t03" no="2" >
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t11" no="10">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t04" no="3">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t12" no="11">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
               <div class="shop_skin_index_list" rel="edit-t05" no="4">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t13" no="12">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t06" no="5">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t14" no="13">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t07" no="6">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t15" no="14">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t08" no="7">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t16" no="15">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t09" no="8" >
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t17" no="16">
						<div class="div_typename r_color"></div>
					</div>
            </div>
    	</div>      <!--icon结束-->
        <div style="height:5px;display:block;"></div>
        <div class="shop_skin_index_list banner shouhou_img" rel="edit-t19" no="18" >
            <div class="img">

            </div>
            <div class="mod" style="display: none;">&nbsp;</div>
        </div>

        <div style="height:5px;display:block;"></div>
        <div class="shop_skin_index_list banner fenlei_img" rel="edit-t20" no="19" style="">
            <div class="img">

            </div>
            <div class="mod" style="display: none;">&nbsp;</div>
        </div>



            <?php
        	$query= "select id,name from weixin_commonshop_types where isvalid=true and parent_id=-1 and is_shelves=true and customer_id=".$customer_id;
			$query=$query." order by id desc";
			$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
			$data=array();
			$data1=array();
			$j=0;
			while ($row = mysql_fetch_object($result)) {
				$pt_id = $row->id;
				$tid = $row->id;
				$pt_name = $row->name;
				$i=0;

				$type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
				$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
				$count1 = mysql_num_rows($result_typeson);
				while($row=mysql_fetch_object($result_typeson)){

					$typeson_id[]=$row->id;
					//$typeson_id1[]=$row->id;
				}

				//$query1= "select count(1) from weixin_commonshop_types where isvalid=true and parent_id=".$pt_id." and customer_id=".$customer_id;
				//if(!empty($owner_typeids)){
				//	$query1 = $query1." and id in(".$owner_typeids.")";
				//}
				//$result1 = _mysql_query($query1) or die('Query failed: ' . mysql_error());


				if($count1>0){
					$data1[$j]['gc_id'] = $pt_id;
					$data1[$j]['gc_name'] = $pt_name;
					$data2=array();
					$sql= "select id,name,imgurl from weixin_commonshop_types   where isvalid=true and top_id=".$pt_id." and customer_id=".$customer_id ;
					if(!empty($owner_typeids)){
						$sql = $sql." and id in(".$owner_typeids.")";
					}
					$sql = $sql." order by id desc limit 9";
						$result2 = _mysql_query($sql) or die('Query failed: ' . mysql_error());
						$result3 = _mysql_query($sql) or die('Query failed: ' . mysql_error());
						?>


		<div class="app-field clearfix clearfix_list  b_white app-preview-anmin" style="border-bottom:1px dashed #999;padding-bottom:4px;"><!--分类楼层开始-->
          <div style="height:10px"></div><div style="width:100%;background-color:#fff">
              <div style="height:5px"></div>
              <div style="width:100%;border-bottom:1px solid #f1f1f1;height:26px;">
                  <a href="../../mshop/list.php?tid=<?php echo $pt_id; ?>&tname=<?php echo $pt_name; ?>&customer_id=<?php echo $customer_id; ?>" style="display:block;height:35px;">
                      <table style="width:100%">
                          <tbody>
                              <tr>
                                  <td align="left" valign="middle">&nbsp;<?php echo $pt_name ?></td><td align="right" valign="middle">更多</td>
                                  <td align="right" valign="middle" style="width:22px"><img src="../common/fengge36/images/1922512065394568.png" style="width:15px"></td>
                                  <td style="width:8px"></td>
                              </tr>
                          </tbody>
                      </table>
                  </a>
                  <div style="height:5px"></div>
              </div>
              <div style="width:100%" class="">
                  <table style="width:100%">
                      <tbody>
                          <tr>
                              <td valign="top" align="center" style="width:45%;vertical-align:top" >
                                  <div style="width:95%;background-color:#07780c;">
                                      <div style="height:5px;"></div>
                                      <?php
                                      while ($row2 = mysql_fetch_object($result2)) {
										$pt_id2_1 = $row2->id;
										$pt_name2 = $row2->name;

										?>

                                         <a href="../../mshop/list.php?customer_id=<?php echo $customer_id;?>&tid=<?php echo $pt_id2_1;?>&tname=<?php echo $pt_name2;?>" style="color:#fff;">
                                          <div style="min-width:33%;float:left;color:#fff"><?php echo $pt_name2 ?></div>
                                      </a>
                                      <?php

									}

                                      ?>


                                      <div style="clear:both"></div>

                                  </div>

                                  <style>
                                  .brand_logo img{width:43px;}
                                  </style>
                                  <div style="width:95%;text-align:left" class="brand_logo">
                                  	 <?php
                                      while ($row3 = mysql_fetch_object($result3)) {
										$pt_id2 = $row3->id;

										$pt_imgurl = $row3->imgurl;
										$pt_name2 = $row3->name;
										$data2[$i]['gb_id'] = $pt_id2;
										$data2[$i]['gb_logo'] = $new_baseurl.$pt_imgurl;
										$data2[$i]['gb_name'] = $pt_name2;

										?>
                                         <a href="../../mshop/list.php?customer_id=<?php echo $customer_id;?>&tid=<?php echo $pt_id2;?>&tname=<?php echo $pt_name2;?>">
                                          <img src="<?php echo $data2[$i]['gb_logo']?>" style="width:31%;float:left;border:1px solid #c5c5c5;margin-left:1px;margin-top:1px">
                                      </a>


                                      <?php
										$i++;
									}
									$data1[$j]['brandinfo'] = $data2;
								$j++;
                                      ?>


                                  </div>
                             </td>
                           <td valign="top" align="center">
                           <style>
                          	.left_img img{max-height:208px;max-width:282px;}
                           </style>
                              <div style="width:100%" class="left_img">
                             <?php
				array_push($typeson_id,$tid);
				$typeson_id=implode(',',$typeson_id);
				$query4 = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id."";

				if(empty($typeson_id)){
					$typeson_id=$tid;
				}
					$query4 = $query4." and (";
					$typeson_id_arr = explode(",",$typeson_id);
					$typeson_id_count = count($typeson_id_arr);
					for($j=0;$j<$typeson_id_count;$j++){
						$o_typeid = $typeson_id_arr[$j];
						if($j==0){
							$query4 = $query4."(type_id=".$o_typeid." or LOCATE(',".$o_typeid.",', type_ids)>0)";
							}else{
							$query4 = $query4." or (type_id=".$o_typeid." or LOCATE(',".$o_typeid.",', type_ids)>0)";
						}
					}
					$query4 = $query4.")";



				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query4 = $query4." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query4 = $query4."(type_id=".$o_typeid." or LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query4 = $query4." or (type_id=".$o_typeid." or LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query4 = $query4.")";
				}
				$query4= $query4." order by asort_value desc,id desc limit 0,4";

				//echo $query;
				$result4 = _mysql_query($query4) or die('Query failed2: ' . mysql_error());

					while ($row4 = mysql_fetch_object($result4)) {
						$pid = $row4->id;
						$pname = $row4->name;
						$orgin_price = $row4->orgin_price;
						$now_price = $row4->now_price;
						$p_img = $row4->default_imgurl;
						$type_ids =$row4->type_ids;
						$pro_discount=$row4->pro_discount;



						if(empty($p_img)){
							$query5 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc ";
							$result5 = _mysql_query($query5) or die('Query failed3: ' . mysql_error());
							$p_img = "";
							while ($row5 = mysql_fetch_object($result5)) {
							$p_img= $row5->imgurl;
							}
						 }




			?>
            					<div class="my_goods">
  										<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id; ?>" >
                                  <img onclick="" src="<?php echo $new_baseurl.$p_img;?>" style="width:50%;float:left;border:0px solid #fff;">
     								</a>
                                  </div>
                            <?php

						}
					?>

                     </div>
                             </td>
                          </tr>
                      </tbody>
                   </table>
              </div>
              <div style="clear:both"></div>
         </div>
     </div><!--分类楼层结束-->
          <?php }
		  unset($typeson_id);
		  }?>


    <div class="app-field clearfix clearfix_list  b_white app-preview-anmin"><!--搜索开始-->
        <div class="custom-search">

             	<form>
                  <input type="search" class="custom-search-input" placeholder="商品搜索：请输入商品关键字" name="searchname"  id="searchname" value="" onkeydown="javascript:if(event.keyCode==13){search_name();return false;}">
                  <button type="button" onclick="search_name()" class="custom-search-button">搜索</button>
                </form>


    </div>
 </div>

	<div class="app-field clearfix clearfix_list  b_white"><!--空白隔开结束-->
        <div class="control-group">
            <div class="custom-line-wrap">
                <hr class="custom-line">
            </div>
        </div>
    </div><!--空白隔开开始-->



	<div class="app-field clearfix clearfix_list  b_white app-preview-anmin" ><!--产品列表开始-->
     <div >
      <div class="control-group" >
          <ul class="sc-goods-list clearfix size-1 card pic" id="list">
          	<?php
			   	$query = "select id,name,now_price,default_imgurl,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
			   }
			   $query= $query." order by asort_value desc,id desc limit 0,20";
                $i=1;
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result)) {
				   $name = $row->name;
				   $pid = $row->id;
				   $now_price=$row->now_price;
				   $p_img = $row->default_imgurl;
				   $sell_count = $row->sell_count;
				   $show_sell_count = $row->show_sell_count;
				   if(empty($p_img)){
					   $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					   $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());
					   $p_img = "";
					   while ($row2 = mysql_fetch_object($result2)) {
						  $p_img= $row2->imgurl;
					   }
				   }

		       ?>

              <li class="goods-card small-pic card">
                  <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id; ?>" class="link js-goods clearfix">
                      <div class="photo-block">
                          <img class="goods-photo js-goods-lazy" name="shopgoodslist3"  src="<?php echo $new_baseurl.$p_img;?>">
                      </div>
                      <div class="info clearfix info-title">
                          <p class="goods-title goods-title_26925 goods-list-title" data-id="26925" style="position:absolute;bottom:45px;"><?php echo $name;?></p>

                          <p class="goods-price-taobao"></p>
                      </div>

                       <div style="position:absolute;bottom:20px;left:0px;">
                          <table style="color:#c5c5c5;font-size:10px;width:100%; margin-top:-10px;">
                              <tbody>
                                  <tr style="height:12px;">
                                      <td align="right" style="color:#ff6600"><em>
									  <?php if(OOF_P != 2) echo OOF_S ?>
									  <?php echo $now_price;?>
									  <?php if(OOF_P == 2) echo OOF_S ?>
									  </em></td>
                                  </tr>
                              </tbody>
                          </table>
                      </div>

                      <div style="position:absolute;bottom:0px;right:0px;">
                          <table style="color:#c5c5c5;font-size:10px;width:100%; margin-top:-10px;">
                              <tbody>
                                  <tr style="height:12px;">
                                      <td align="right" style="color:#999">售<?php echo $sell_count+$show_sell_count;?>笔&nbsp;</td>
                                  </tr>
                              </tbody>
                          </table>
                      </div>
                 </a>
              </li>
             <?php
		           if(fmod($i,2)==0){
				      echo "<div class=\"clear\"></div>";
				   }

		           $i++;
		     }
            ?>

          </ul>
          <div class="component-border"></div>

      </div>

      </div>
           <?php if($i==21){ ?>
		 <script type="text/javascript" src="../common/js/page/fengge36.js"></script>
		<div class="shop_skin_index_list" style="width:100%;margin-bottom: 10px;">
			<h1 style="background:#ddd;"><button type="button" id="more_commodity" class="div_typename" style="background:#ddd;color:#666;font-size:16px;width:100%;height: 25px;" onclick="get_commodity_detail(<?php echo $customer_id; ?>,'<?php echo $owner_typeids?$owner_typeids:"-1"; ?>');">点击加载更多</button></h1>
		</div>
		<?php } ?>
  </div><!--产品列表开始-->
   </div>

		<?php if($is_showbottom_menu){
		/*<div style="margin-bottom:50px;"></div><!--底部固定栏-->
		<div class="button_tab_menu">
			<table>
				<tbody>
					<tr>
						<td align="center" valign="middle" style="width: 19%;">
							<div class="footer_div">

									<div class="shop_skin_index_list" rel="edit-t21" no="20">
										<div class="footer_tab_index_0 footer_icon footer_icon_0 img"></div>
									</div>

									<div class="name shop_skin_index_list" rel="edit-t25" no="24">
										<div class="div_typename r_color"></div>
									</div>

							</div>




						</td>
						<td align="center" valign="middle" style="width: 19%;">
							<div class="footer_div">

									<div class="shop_skin_index_list" rel="edit-t22" no="21">
										<div class="footer_tab_index_1 footer_icon footer_icon_1 img"></div>
									</div>
									<div class="name shop_skin_index_list" rel="edit-t26" no="25">
										<div class="div_typename r_color"></div>
									</div>

							</div>
						</td>
						<td align="center" valign="middle" style="width: 24%;">

								<div id="logo" class="shop_skin_index_list" style="position:absolute;" rel="edit-t29" no="28">
								<center>
									<div id="divuserheader" class="footer_tab_index_2 footer_icon footer_icon_2 img"></div>
								</center>
								</div>&nbsp;

						</td>
						<td align="center" valign="middle" style="width: 19%;">
							<div class="footer_div">

									<div class="shop_skin_index_list" rel="edit-t23" no="22">
										<div class="footer_tab_index_2 footer_icon footer_icon_2 img"></div>
									</div>
									<div class="name shop_skin_index_list" rel="edit-t27" no="26">
										<div class="div_typename r_color"></div>
									</div>

							</div>
						</td>
						<td align="center" valign="middle" style="width: 19%;">
							<div class="footer_div">

									<div class="shop_skin_index_list" rel="edit-t24" no="23">
										<div class="footer_tab_index_3 footer_icon footer_icon_3 img"></div>
									</div>
									<div class="name shop_skin_index_list" rel="edit-t28" no="27">
										<div class="div_typename r_color"></div>
									</div>

							</div>
						</td>
					</tr>
				</tbody>
			</table>
		</div>*/
		 }?>
</div>

<?php }else if($template_id==37){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div class="header" style="padding:0px;">
    	<div class="shop_skin_index_list banner"  rel="edit-t01">
        	<div class="img" >
			</div>
        </div>
    </div>
	<script>
	$(document).ready(function(){
		var window_height=$(window).height();
		var window_width=$(window).width();

		var header =$(".header");
		var header_height =window_height/2;
		var header_width =window_width/2;
		//header.css("height",header_height+"px");
		$(".banner img").css("height",header_width+"px");

	});
	</script>
 	<div class="marquee shop_skin_index_list"  rel="edit-t18" no="17">
		<marquee scrollamount="2">
		<div class="div_typename r_color" style="color:#e60014"></div>
		</marquee>
	</div>
	<style>
	.icon-37 img{width:2vw;height:12vw!important;max-height:120px!important;}
	</style>
    <div id="app-field-model-page-1" style="width:100%">

        <div class="app-field clearfix clearfix_list b_white app-preview-anmin icon-37"><!--icon开始-->
            <div style="height: 10px;"></div>

            <div style="width:25%;float:left;text-align:center;">
              <div class="shop_skin_index_list" rel="edit-t02" no="1">
                  <div class="img"></div>
              </div>
               <div class="name shop_skin_index_list" rel="edit-t10" no="10">
                  <div class="div_typename r_color"></div>
              </div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t03" no="2" >
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t11" no="10">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t04" no="3">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t12" no="11">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
               <div class="shop_skin_index_list" rel="edit-t05" no="4">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t13" no="12">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t06" no="5">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t14" no="13">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t07" no="6">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t15" no="14">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t08" no="7">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t16" no="15">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t09" no="8" >
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t17" no="16">
						<div class="div_typename r_color"></div>
					</div>
            </div>
    	</div>      <!--icon结束-->
        <div class="shop_skin_index_list" rel="edit-t31" no="30"><!--添加视频-->
			<div class="div_typevideo"></div>
		</div>


        <div style="height:5px;display:block;"></div>
            <div class="shop_skin_index_list banner " rel="edit-t19" no="18">
                <div class="img shouhou_img">

                </div>

            </div>

        	<div style="height:3px;display:block;"></div>
        	<div class="shop_skin_index_list banner" rel="edit-t20" no="19">
                <div class="img shouhou_img" >

                </div>

            </div>


			 <?php  //分类
			    $query="";
				if($is_shopgeneral){
				   $query= "select * from weixin_commonshop_types where isvalid=true and parent_id=-1 and is_shelves=true and customer_id=".$customer_id."";
				}else{
				   $query= "select * from weixin_commonshop_types where isvalid=true and parent_id=-1 and is_shelves=true and customer_id=".$customer_id;
				  // $query=$query." order by id desc";
				}
				if($sort_str){
				 $query =$query.' order by field(id'.$sort_str.')';
				 }
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				$data=array();
				$data1=array();
				$j=0;
				while ($row = mysql_fetch_object($result)) {
					$pt_id = $row->id;
					$pt_name = $row->name;
					$i=0;

					$query1= "select * from weixin_commonshop_types where isvalid=true and top_id=".$pt_id." and customer_id=".$customer_id;
					if(!empty($owner_typeids)){
						$query1 = $query1." and id in(".$owner_typeids.")";
					}
					if($is_shopgeneral){
					   $query1=$query1." order by create_type asc";
					}

					$result1 = _mysql_query($query1) or die('Query failed: ' . mysql_error());
					$count1 = mysql_num_rows($result1);

					if($count1>0){
						$data1[$j]['gc_id'] = $pt_id;
						$data1[$j]['gc_name'] = $pt_name;
						$data2=array();
						$sql= "select * from weixin_commonshop_types   where isvalid=true and top_id=".$pt_id." and customer_id=".$customer_id ;
						if(!empty($owner_typeids)){
							$sql = $sql." and id in(".$owner_typeids.")";
						}
						if($is_shopgeneral){
						   $sql=$sql." order by create_type asc";
						}else{
						   $sql = $sql." order by id desc limit 6";
						}
						//$result2 = _mysql_query($sql) or die('Query failed: ' . mysql_error());
						$result3 = _mysql_query($sql) or die('Query failed: ' . mysql_error());
							?>

			<div class="app-field clearfix clearfix_list  b_white app-preview-anmin" style="border-bottom:1px dashed #999;padding-bottom:4px;margin-bottom:5px;"><!--分类楼层开始-->
				  <div style="height:5px"></div>
				  <div style="width:100%;background-color:#fff">
					  <div style="height:5px"></div>
						  <a href="../../mshop/list.php?tid=<?php echo $pt_id; ?>&tname=<?php echo $pt_name; ?>&customer_id=<?php echo $customer_id_en; ?>" style="display:block;">
						  <div class="brand_head">
							  <span class="cat_name"><?php echo $pt_name ?></span>
							  <span class="more">更多>></span>
						  </div>
						  </a>
						  <div style="height:5px"></div>
						  <div class="brand_list">
							<ul>
								<?php
								  while ($row3 = mysql_fetch_object($result3)) {
									$pt_id2 = $row3->id;

									$pt_imgurl = $row3->imgurl;
									$pt_name2 = $row3->name;
									$data2[$i]['gb_id'] = $pt_id2;
									$data2[$i]['gb_logo'] = $new_baseurl.$pt_imgurl;
									$data2[$i]['gb_name'] = $pt_name2;

									?>
								<li>
									<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en;?>&tid=<?php echo $pt_id2;?>&tname=<?php echo $pt_name2;?>">
									<img src="<?php echo $data2[$i]['gb_logo']?>" class="brand_img">
									</a>
								</li>
								<?php
											$i++;
										}
										$data1[$j]['brandinfo'] = $data2;
									$j++;
										  ?>
							</ul>
						  </div>

				   </div>
				</div>
				<?php     }
			        }

				?>


            <div class="shop_skin_index_list banner" rel="edit-t22" no="21">
                <div class="img shouhou_img">

                </div>

            </div>


            <div class="app-field clearfix clearfix_list  b_white app-preview-anmin"><!--搜索开始-->
                <div class="custom-search">
                  <form>
                    <input type="search" class="custom-search-input" placeholder="商品搜索：请输入商品关键字" name="searchname"  id="searchname" value="" onkeydown="javascript:if(event.keyCode==13){search_name();return false;}">
                    <button type="button" onclick="search_name()" class="custom-search-button">搜索</button>
                  </form>
            	</div>
         	</div>
             <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){

		?>
        	<style>
				.custom-search{margin-bottom:0px!important;}
			</style>
			<div class="" style="width:100%;display:block;margin-bottom:49px;float:left;margin-top:20px;padding-bottom:20px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
        <?php if($is_showbottom_menu){
			/*<div  class="clear"></div>
            <div class="button_tab_menu">
                <!--distribution contact us end-->
                <dl class="sub-nav nav-b5">
                    <dd class="active">
                        <div class="nav-b5-relative shop_skin_index_list" rel="edit-t23" no="22"><div class="img"></div></div><div class="name shop_skin_index_list" rel="edit-t27" no="26">
                    <div class="div_typename div_font" style="color:#2b9939"></div>
                </div>
                    </dd>
                    <dd>
                          <div class="nav-b5-relative shop_skin_index_list" rel="edit-t24" no="23"><div class="img"></div></div><div class="name shop_skin_index_list" rel="edit-t28" no="27">
                    <div class="div_typename div_font" ></div>
                </div>
                    </dd>
                    <dd>
                          <div class="nav-b5-relative shop_skin_index_list" rel="edit-t25" no="24"><div class="img"></div></div><div class="name shop_skin_index_list" rel="edit-t29" no="28">
                    <div class="div_typename div_font" ></div>
                </div>
                    </dd>
                    <dd>
                          <div class="nav-b5-relative shop_skin_index_list" rel="edit-t26" no="25"><div class="img"></div></div><div class="name shop_skin_index_list" rel="edit-t30" no="29">
                    <div class="div_typename div_font" ></div>
                </div>
                    </dd>
                </dl>
			</div>*/
			/*判断是否显示底部菜单 start*/
			require_once('../../common/utility_setting_function.php');
			$fun = "index";
			$is_publish = check_is_publish(2,$fun,$customer_id);

			if($is_publish){
				require_once('../../mshop/bottom_label.php');
			}
			/*判断是否显示底部菜单 end*/
		 }?>
    </div>
</div>
<?php }else if($template_id==38){?>
<style>
.bg_img img{width:100%;height:100%;}
#category{display:none;}
</style>
<script>
var window_width=$(window).width();
$("#bg_img img").css("width",window_width);
</script>

	<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>

        <div class="shop_slider shop_slider_auto mod_pic_mt_1" >
            <div class="inner bg_img" id="bg_img" data-tag="slider-warp" style="visibility: visible;">
            	<div class="shop_skin_index_list banner"  rel="edit-t01" no="0">
                    <div class="img" >
                        <ul class="pic_list" data-tag="slider-list">

                        </ul>
                    </div>
                </div>

            </div>
        </div>

        <?php //获取头像
			$query3="select weixin_headimgurl from weixin_users where isvalid=true and customer_id=".$customer_id ." and weixin_fromuser='".$fromuser."' order by id desc limit 0,1";
			$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
			while ($row = mysql_fetch_object($result3))
			{
				$headimgurl = $row->weixin_headimgurl;
			}
			if(!empty($headimgurl))
		?>
        <style>
        .div_font{font-size:12px;}
        </style>

        <section class="members_head_nav">
            <section class="members_head_nav_le" style="z-index:999;"><img src="<?php echo $headimgurl; ?>" width="60" height="60"></section>
            <section class="members_head_nav_ri">
                <ul>

                    <li >
                        <span class="iconjh" >
                            <div class="shop_skin_index_list" rel="edit-t02" no="1" >
                            	<div class="img"></div>
                            </div>
                        </span>
                        <div class="name shop_skin_index_list" rel="edit-t07" no="6">
                        	<div class="div_typename div_font" ></div>
                        </div>
                    </li>
                    <li >
                        <span class="iconjh" >
                            <div class="shop_skin_index_list" rel="edit-t03" no="2">
                            	<div class="img"></div>
                        	</div>
                        </span>
                        <div class="name shop_skin_index_list" rel="edit-t08" no="7">
                        	<div class="div_typename div_font" ></div>
                        </div>
                    </li>
                    <li>
                        <span class="iconjh" >
                            <div class="shop_skin_index_list" rel="edit-t04" no="3">
                            	<div class="img"></div>
                            </div>
                        </span>
                        <div class="name shop_skin_index_list" rel="edit-t09" no="8">
                        	<div class="div_typename div_font" ></div>
                        </div>
                    </li>
                     <li >
                        <span class="iconjh" >
                            <div class="shop_skin_index_list" rel="edit-t05" no="4">
                            	<div class="img"></div>
                            </div>
                        </span>
                        <div class="name shop_skin_index_list" rel="edit-t10" no="9">
                        	<div class="div_typename div_font" ></div>
                        </div>
                    </li>
                    <li>
                        <span class="iconjh" >
                            <div class="shop_skin_index_list" rel="edit-t06" no="5">
                            	<div class="img"></div>
                            </div>
                        </span>
                        <div class="name shop_skin_index_list" rel="edit-t11" no="10">
                        	<div class="div_typename div_font" ></div>
                        </div>

                    </li>

                </ul>
            </section>
        </section class>

		<script>
			$(document).ready(function(){
			var window_width=$(window).width();
			$(".members_co img").css("width",window_width+"px");
			$(".members_co img").css("height",window_width*13/32+"px");
			$(".members_co1 img").css("width",window_width+"px");
			$(".members_co1 img").css("height",window_width*11/64+"px");
			});
		</script>
        <div class="members_co" style="float:left;">
            <div class="shop_skin_index_list"  rel="edit-t12" no="11">
                <div class="img"></div>
            </div>
        </div>

        <div class="margin" style="margin-bottom:5px;float:left;"><!--分类楼层开始-->
			<?php
            $query1="select id,index_imgurl,index_catnum,cat_adurl from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
            if(!empty($owner_typeids)){
                $query1 = $query1." and id in (".$owner_typeids.")";
            }
            $query1=$query1." order by id desc";
            $result1 = _mysql_query($query1) or die('Query failed: ' . mysql_error());
            while ($row = mysql_fetch_object($result1)) {
                $tid = $row->id;
                $index_imgurl = $row->index_imgurl;
                $index_catnum = $row->index_catnum;
                $cat_adurl = $row->cat_adurl;

				$type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
				$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
				while($row=mysql_fetch_object($result_typeson)){

					$typeson_id[]=$row->id;
					//$typeson_id1[]=$row->id;
				}


            ?>
            <section class="members_goodspic">
                <ul>
                    <div class="members_con members_co1" style="margin:0px!important">
                        <div class="shop_skin_index_list">
                            <div class="img">
                                <a href="<?php echo $cat_adurl;?>"><img src="<?php echo $new_baseurl.$index_imgurl;?>"></a>
                            </div>
                        </div>
                    </div>
                    <?php
			array_push($typeson_id,$tid);
			$typeson_id=implode(',',$typeson_id);

            $query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id."";

			if(empty($typeson_id)){
				$typeson_id=$tid;
			}
				$query = $query." and (";
				$typeson_id_arr = explode(",",$typeson_id);
				$typeson_id_count = count($typeson_id_arr);
				for($j=0;$j<$typeson_id_count;$j++){
					$o_typeid = $typeson_id_arr[$j];
					if($j==0){
						$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						}else{
						$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
					}
				}
				$query = $query.")";


			// echo $query;
            if(!empty($owner_typeids)){
             //查找自己微店的产品
                 $query = $query." and (";
                 $owner_typeids_arr = explode(",",$owner_typeids);
                 $owner_typeids_count = count($owner_typeids_arr);
                 for($j=0;$j<$owner_typeids_count;$j++){
                     $o_typeid = $owner_typeids_arr[$j];
                     if($j==0){
                        $query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
                     }else{
                        $query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
                     }
                 }
                 $query = $query.")";
            }
            $query= $query." order by asort_value desc,id desc limit 0,".$index_catnum."";
            // echo $query;
            $result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
                while ($row = mysql_fetch_object($result)) {
                    $pid = $row->id;
                    $pname = $row->name;
                    $orgin_price = $row->orgin_price;
                    $now_price = $row->now_price;
                    $p_img = $row->default_imgurl;
                    $type_ids =$row->type_ids;
                    $pro_discount=$row->pro_discount;
                    $sell_count =$row->sell_count;
                    $show_sell_count =$row->show_sell_count;

                    if(empty($p_img)){
                        $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
                        $result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
                        $p_img = "";
                        while ($row2 = mysql_fetch_object($result2)) {
                        $p_img= $row2->imgurl;
                        }
                     }


        ?>
                  <li class="mingoods">
                      <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                          <img class="lazy" src="<?php echo $new_baseurl.$p_img;?>" data-original="<?php echo $new_baseurl.$p_img;?>" width="100%" style="display: inline;/*margin:0 9px;*/">
                      </a>
                      <span class="goods-title"><a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>" style="font-size:12px;display:block;overflow:hidden;height:16px;"><?php echo $pname;?></a></span>
                      <span class="price">
					  <?php if(OOF_P != 2) echo OOF_S ?>
					  <?php echo $now_price;?>
					  <?php if(OOF_P == 2) echo OOF_S ?>
					  </span>
                      <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><div class="buy_btn"><div class="buy_btn"><input type="button" value="立即购买" class="buynow_btn"></div></div></a>
                  </li>
                    <?php }?>
                </ul>
            </section>
            <?php
			unset($typeson_id);
			}?>
        </div> <!--产品分类结束-->
    		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;float:left;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>

       	<!--<div style="position:fixed;bottom:0px;height:35px;width:100%;z-index:999;background-color:#fff;">
        	<!--    <div class="members_con" style="width:100%;display:block;border-top:1px solid #8b8b8b;margin-left:0px!important;padding-top:5px;">
                <div class="shop_skin_index_list bottom_menu_img"  rel="edit-t17" no="16" >
                    <div class="img" align="center"></div>
                </div>
                <div class="name shop_skin_index_list bottom_menu" rel="edit-t18" no="17">
                        <div class="div_font bottom_font" ><a  href="#" class="div_typename"></a></div>
                </div>
                <div class="name shop_skin_index_list bottom_menu" rel="edit-t19" no="18">
                    <div class="div_font bottom_font" ><a  href="#" class="div_typename"></a></div>
                </div>
                <div class="name shop_skin_index_list bottom_menu" rel="edit-t20" no="19">
                    <div class="div_font bottom_font" ><a  href="#" class="div_typename"></a></div>
                </div>
            </div>
		</div>
        -->
	</div>

<?php }else if($template_id==39){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="header bg_img" style="padding:0px;">
            <div class="shop_skin_index_list banner"  rel="edit-t01" no="0">
                <div class="img">
                    <img src="fengge34/css/images/20150521072033344276.jpg" class="">
                </div>
                <div class="mod" style="display: none;">&nbsp;</div>
            </div>
        </div>
        <style>
         .shop_skin_index_list .div_typename{display:block;height:20px!important;}
		 .members_head_nav .div_typename{color:#fff!important;width:56px;display:block;line-height:26px;}
		 #category{display:none;}

        </style>
            <section class="members_head_nav">
            <?php //获取头像
				$query3="select weixin_headimgurl from weixin_users where isvalid=true and customer_id=".$customer_id ." and weixin_fromuser='".$fromuser."' order by id desc limit 0,1";
				$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result3))
				{
					$headimgurl = $row->weixin_headimgurl;
				}
			?>
            	<div class="phone-homepage ">
            	<div class="phone-homepage-first" style="z-index:999"><img src="<?php echo $headimgurl;?>" class="img-responsive"/></div>
				<div style="padding-left:19%;">
                    <ul style="width:100%;overflow:hidden;">

                        <li>
                            <div class="name shop_skin_index_list" rel="edit-t02" no="1">
                                <div class="div_font" ><a  href="#" class="div_typename"></a></div>
                            </div>
                        </li>
                        <li>
                            <div class="name shop_skin_index_list" rel="edit-t03" no="2">
								<div class="div_font" ><a  href="#" class="div_typename"></a></div>
                            </div>
                        </li>
                        <li>
                            <div class="name shop_skin_index_list" rel="edit-t04" no="3">
                                <div class="div_font" ><a  href="#" class="div_typename"></a></div>
                            </div>
                        </li>
                        <li>
                            <div class="name shop_skin_index_list" rel="edit-t05" no="4">
                                <div class="div_font" ><a  href="#" class="div_typename"></a></div>
                            </div>
                        </li>
                    </ul>
            	</div>
		</div>
            </section>

			<div class="members_con members_co">
                <div class="shop_skin_index_list"  rel="edit-t06" no="5">
                	<div class="img"></div>
                </div>
            </div>
            <div class="members_con members_co1">
                <div class="shop_skin_index_list"  rel="edit-t07" no="6">
                	<div class="img"></div>
                </div>
            </div>

			<?php
			$tem_floor="select id,position from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=39 and isvalid=true and (POSITION >=11 AND POSITION <=16 ) order by position asc";
			$result_tem_floor=_mysql_query($tem_floor) or die ('tem_floor faild ' .mysql_error());
			while($row=mysql_fetch_object($result_tem_floor)){
				$position=$row->position;


			?>
				<div class="members_con members_co1">
					<div class="shop_skin_index_list"  rel="edit-t<?php echo $position?>" no="<?php echo $position-1?>">
						<div class="img"></div>
					</div>
				</div>
			<?php
				}
			?>


				  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;float:left;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
		<?php if($is_showbottom_menu){
            /*<div class="members_con" style="width:100%;display:block;margin-top:5px;margin-left:0px!important;padding-top:5px;background:#ecffff;">

                <div class="name shop_skin_index_list bottom_menu" rel="edit-t08" no="7">
						<div class="div_font" ><a  href="#" class="div_typename"></a></div>
                </div>
                <div class="name shop_skin_index_list bottom_menu" rel="edit-t09" no="8">
                    <div class="div_font" ><a  href="#" class="div_typename"></a></div>
                </div>
                <div class="name shop_skin_index_list bottom_menu" rel="edit-t10" no="9">
                    <div class="div_font" ><a  href="#" class="div_typename"></a></div>
                </div>
         	</div>*/
			/*判断是否显示底部菜单 start*/
			require_once('../../common/utility_setting_function.php');
			$fun = "index";
			$is_publish = check_is_publish(2,$fun,$customer_id);

			if($is_publish){
				require_once('../../mshop/bottom_label.php');
			}
			/*判断是否显示底部菜单 end*/
		 }?>
    </div>
 <?php }else if($template_id==40){?>

 <div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div class="main">
            <div class="header">
                <div class="bg-green">
                	<div class="shop_skin_index_list banner bg_img"  rel="edit-t01" no="0">
                		<div class="img"></div>
                		<div class="mod" style="display: none;">&nbsp;</div>
                    </div>
                </div>
                <?php //获取头像
				$query3="select weixin_headimgurl from weixin_users where isvalid=true and customer_id=".$customer_id ." and weixin_fromuser='".$fromuser."' order by id desc limit 0,1";
				$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result3))
				{
					$headimgurl = $row->weixin_headimgurl;
				}
				?>
                <img src="<?php echo $headimgurl;?>" class="head-photo">
                <div class="bg-white">
                    <div class="op">
                    	<div class="shop_skin_index_list" rel="edit-t05" no="4">
                        	<div class="img"></div>
                        </div>
                        <p class="text-grey">
                        	<div class="name shop_skin_index_list" rel="edit-t06" no="5">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                    </div>
                    <div class="op br-right">
                    	<div class="shop_skin_index_list" rel="edit-t03" no="2">
                        	<div class="img"></div>
                        </div>
                        <p class="text-grey">
                        	<div class="name shop_skin_index_list" rel="edit-t04" no="3">
								<div class="div_typename div_font" ></div>
							</div>
                       	</p>
                    </div>
                    <div class="op br-right">
                    	<?php
                		$query = "select count(1) as count from weixin_commonshop_products where isvalid=true and isout=false and customer_id=".$customer_id;
                        if(!empty($owner_typeids)){
						 //查找自己微店的产品
							 $query = $query." and (";
							 $owner_typeids_arr = explode(",",$owner_typeids);
							 $owner_typeids_count = count($owner_typeids_arr);
							 for($j=0;$j<$owner_typeids_count;$j++){
								 $o_typeid = $owner_typeids_arr[$j];
								 if($j==0){
									$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
								 }else{
									$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
								 }
							 }
							 $query = $query.")";
						}
						$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
                        while($row=mysql_fetch_object($result)){
                            $allcount=$row->count;
                        }
						?>
                    	<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>"><p class="text-green"><?php echo $allcount;?></p></a>
                    	<p class="text-grey">
                        	<div class="name shop_skin_index_list" rel="edit-t02" no="1">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                    </div>



                </div>
            </div>
            <div class="search-box">
                <input type="text" class="search-text" id="searchname" name="searchname" placeholder="商品搜索：请输入商品关键字">
               <input type="button" class="search-button" onclick="search_name()" value="搜索">


            </div>
            <div class="item-box">
            <div class="content-box">
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t07" no="6">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t19" no="18">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t08" no="7">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t20" no="19">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t09" no="8">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t21" no="20">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>

                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t10" no="9">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t22" no="21">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t11" no="10">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t23" no="22">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t12" no="11">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t24" no="23">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t13" no="12">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t25" no="24">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t14" no="13">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t57" no="56">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t15" no="14">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t26" no="25">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t16" no="15">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t27" no="26">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t17" no="15">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t28" no="27">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="icon-box">
                    	<div class="shop_skin_index_list" rel="edit-t18" no="17">
                        	<div class="img"></div>
                        </div>
                        <p>
                        	<div class="name shop_skin_index_list" rel="edit-t29" no="28">
								<div class="div_typename div_font" ></div>
							</div>
                        </p>
                </div>
                <div class="clear"></div>
            </div>
            <div class="bg-grey"></div>
            </div>
            <div class="hot-market">
                <div class="title-box">
                    <div class="title">
                    	<div class="name shop_skin_index_list" rel="edit-t47" no="46">
								<div class="div_typename div_font" ></div>
						</div>
                    </div>
                </div>
                <div class="market-box">
                    <div class="half-box border-r">


                        <!--	<div class="name shop_skin_index_list" rel="edit-t36" no="35">
                        		<div class="div_typename div_font" ></div>
                        	</div>

                      	-->

                        <div class="shop_skin_index_list " rel="edit-t30" no="29">
                        	<div class="img hot-market hotimg"></div>
                        </div>

                    </div>
                    <div class="half-box">
                       <!--
                        <p class="name">
                        	<div class="name shop_skin_index_list" rel="edit-t37" no="36">
                        		<div class="div_typename div_font" ></div>
                        	</div>
                        </p>
                        -->
                        <div class="shop_skin_index_list" rel="edit-t31" no="30">
                        	<div class="img hot-market hotimg"></div>
                        </div>
                    </div>
                    <div class="four-box border-r">
                        <!--
                        <p class="name">
                        	<div class="name shop_skin_index_list" rel="edit-t38" no="37">
                        		<div class="div_typename div_font" ></div>
                        	</div>
                        </p>
                        -->
                        <div class="shop_skin_index_list" rel="edit-t32" no="31">
                        	<div class="img hot-market hotimg2"></div>
                        </div>
                    </div>
                    <div class="four-box border-r">
                        <!--
                        <p class="name">
                        	<div class="name shop_skin_index_list" rel="edit-t39" no="38">
                        		<div class="div_typename div_font" ></div>
                        	</div>
                        </p>
                        -->
                        <div class="shop_skin_index_list" rel="edit-t33" no="32">
                        	<div class="img hot-market hotimg2"></div>
                        </div>
                    </div>
                    <div class="four-box border-r">
                        <!--
                        <p class="name">
                        	<div class="name shop_skin_index_list" rel="edit-t40" no="39">
                        		<div class="div_typename div_font" ></div>
                        	</div>
                        </p>
                        -->
                        <div class="shop_skin_index_list" rel="edit-t34" no="33">
                        	<div class="img hot-market hotimg2"></div>
                        </div>
                    </div>
                    <div class="four-box">
                        <!--
                        <p class="name">
                        	<div class="name shop_skin_index_list" rel="edit-t41" no="40">
                        		<div class="div_typename div_font" ></div>
                        	</div>
                        </p>
                        -->
                        <div class="shop_skin_index_list" rel="edit-t35" no="34">
                        	<div class="img hot-market hotimg2"></div>
                        </div>
                    </div>
                </div>

                	<div class="shop_skin_index_list ad1_img" rel="edit-t42" no="41" style="margin:3px 0px;">
                    	<div class="img"></div>
                	</div>


            </div>

            <div class="like-box">
                 <div class="title-box">
                    <div class="title">
                    	<div class="name shop_skin_index_list" rel="edit-t48" no="47">
								<div class="div_typename div_font"></div>
						</div>
                    </div>
                 </div>
                 <div class="product-box">
                    <div class="shop_skin_index_list" rel="edit-t43" no="42">
                    	<div class="img like-market"></div>
                    </div>
                 </div>
                 <div class="product-box">
                     <div class="shop_skin_index_list" rel="edit-t44" no="43">
                    	<div class="img like-market"></div>
                    </div>

                 </div>

                 <div class="product-box">
                    <div class="shop_skin_index_list" rel="edit-t45" no="44">
                    	<div class="img like-market"></div>
                    </div>
                 </div>
                 <div class="product-box">
                    <div class="shop_skin_index_list" rel="edit-t46" no="45">
                    	<div class="img like-market"></div>
                    </div>
                 </div>
            </div>

            <div class="good-box">
                 <div class="title-box">
                    <div class="title">最新商品</div>
                 </div>
                  <?php
						$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;
						if(!empty($owner_typeids)){
						 //查找自己微店的产品
							 $query = $query." and (";
							 $owner_typeids_arr = explode(",",$owner_typeids);
							 $owner_typeids_count = count($owner_typeids_arr);
							 for($j=0;$j<$owner_typeids_count;$j++){
								 $o_typeid = $owner_typeids_arr[$j];
								 if($j==0){
									$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
								 }else{
									$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
								 }
							 }
							 $query = $query.")";
						}
						$query= $query." order by asort_value desc,createtime desc limit 0,10";
						//echo $query;
						$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
						while ($row = mysql_fetch_object($result)) {
							$pid = $row->id;
							$pname = $row->name;
							$orgin_price = $row->orgin_price;
							$now_price = $row->now_price;
							$p_img = $row->default_imgurl;
							$type_ids =$row->type_ids;
							$pro_discount=$row->pro_discount;
							$sell_count =$row->sell_count;
							$show_sell_count =$row->show_sell_count;

							if(empty($p_img)){
								$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
								$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
								$p_img = "";
								while ($row2 = mysql_fetch_object($result2)) {
								$p_img= $row2->imgurl;
								}
							 }
					?>
                         <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                         <div class="product-box">
                             <img src="<?php echo $new_baseurl.$p_img;?>" data-original="<?php echo $new_baseurl.$p_img;?>">
                             <div class="right-box">
                             <p class="name"><?php echo $pname;?></p>

                             <div class="price">
                                 <span class="num"><?php if(OOF_P != 2) echo OOF_S ?><?php echo $now_price;?><?php if(OOF_P == 2) echo OOF_S ?></span>
                                 <span class="num_pass"><?php if(OOF_P != 2) echo OOF_S ?><?php echo $orgin_price;?><?php if(OOF_P == 2) echo OOF_S ?></span>
                             </div>
                             <div class="price_bottom"><span class="discount"><?php echo number_format($now_price/$orgin_price*10,1);?>折</span><span class="sellcount">已售：&nbsp;<?php echo $sell_count+$show_sell_count;?></span></div>
                             </div>
                         </div>
                         </a>


                 <?php }?>
             </div>
            	  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;padding-bottom:18px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
		<?php if($is_showbottom_menu){
            /*<div class="footer">
				<div class="footer-box">
					<div class="weidian active">

							<div class="shop_skin_index_list" rel="edit-t49" no="48">
								<div class="img"></div>
							</div>
							<p>
								<div class="name shop_skin_index_list" rel="edit-t53" no="52">
									<div class="div_typename div_font" ></div>
								</div>
							</p>

					</div>
					<div class="weidian">

							<div class="shop_skin_index_list" rel="edit-t50" no="49">
								<div class="img"></div>
							</div>
							<p>
								<div class="name shop_skin_index_list" rel="edit-t54" no="53">
									<div class="div_typename div_font" ></div>
								</div>
							</p>

					</div>
					<div class="weidian">

							<div class="shop_skin_index_list" rel="edit-t51" no="50">
								<div class="img"></div>
							</div>
							<p>
								<div class="name shop_skin_index_list" rel="edit-t55" no="54">
									<div class="div_typename div_font" ></div>
								</div>
							</p>

					</div>
					<div class="weidian">

							<div class="shop_skin_index_list" rel="edit-t52" no="51">
								<div class="img"></div>
							</div>
							<p>
								<div class="name shop_skin_index_list" rel="edit-t56" no="55">
									<div class="div_typename div_font" ></div>
								</div>
							</p>

					</div>
				</div>
            </div>*/
			/*判断是否显示底部菜单 start*/
			require_once('../../common/utility_setting_function.php');
			$fun = "index";
			$is_publish = check_is_publish(2,$fun,$customer_id);

			if($is_publish){
				require_once('../../mshop/bottom_label.php');
			}
			/*判断是否显示底部菜单 end*/
		 }?>
           <!--<div class="clear-fix"></div>-->
        </div>

</div>

<?php }else if($template_id==41){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
<div class="main">
    <div class="header"><!--头部开始-->
    	<div class="shop_skin_index_list banner"  rel="edit-t01" no="0">
            <div class="img"></div>
            <div class="mod" style="display: none;">&nbsp;</div>
        </div>

        <?php //获取头像
			$query3="select weixin_headimgurl from weixin_users where isvalid=true and customer_id=".$customer_id ." and weixin_fromuser='".$fromuser."' order by id desc limit 0,1";
			$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
			while ($row = mysql_fetch_object($result3))
				{
					$headimgurl = $row->weixin_headimgurl;
				}
		?>


        <img src="<?php echo $headimgurl;?>" class="picture" >
        <div class="detail-info">
            <div class="one">

           		 <?php
                        $query = "select count(1) as count from weixin_commonshop_products where isvalid=true and isout=false and customer_id=".$customer_id;
                        if(!empty($owner_typeids)){
						 //查找自己微店的产品
							 $query = $query." and (";
							 $owner_typeids_arr = explode(",",$owner_typeids);
							 $owner_typeids_count = count($owner_typeids_arr);
							 for($j=0;$j<$owner_typeids_count;$j++){
								 $o_typeid = $owner_typeids_arr[$j];
								 if($j==0){
									$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
								 }else{
									$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
								 }
							 }
							 $query = $query.")";
						}

						$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
                        while($row=mysql_fetch_object($result)){

                            $allcount=$row->count;
                        }
                    ?>
                <p class="num">
					<?php echo $allcount;?>
                </p>
                <p class="name">
                	<div class="name shop_skin_index_list" rel="edit-t07" no="6">

                        <a class="div_typename div_font"></a>
                    </div>
                </p>
            </div>
            <div class="one">
                <p class="num">
                <?php

					$query = "select count(1) as count from weixin_commonshop_products where isout=false and isvalid=true and isnew=true and customer_id=".$customer_id;
					if(!empty($owner_typeids)){
					 //查找自己微店的产品
						 $query = $query." and (";
						 $owner_typeids_arr = explode(",",$owner_typeids);
						 $owner_typeids_count = count($owner_typeids_arr);
						 for($j=0;$j<$owner_typeids_count;$j++){
							 $o_typeid = $owner_typeids_arr[$j];
							 if($j==0){
								$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }else{
								$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }
						 }
						 $query = $query.")";
					}
					$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
					while($row=mysql_fetch_object($result)){
						echo $newcount=$row->count;
						}
				?>
                </p>
                <p class="name">
                	<div class="name shop_skin_index_list" rel="edit-t08" no="7">

                        <a class="div_typename div_font"></a>
                    </div>
                </p>
            </div>
            <div class="one">
                <div class="shop_skin_index_list" rel="edit-t12" no="11">
                    <div class="img"></div>
                </div>
                <p class="name">
                	<div class="name shop_skin_index_list" rel="edit-t09" no="8">

                        <a class="div_typename div_font"></a>
                    </div>
                </p>
            </div>
            <div class="one">
                <div class="shop_skin_index_list" rel="edit-t13" no="12">
                    <div class="img"></div>
                </div>
                <p class="name">
                	<div class="name shop_skin_index_list" rel="edit-t10" no="9">

                        <a class="div_typename div_font"></a>
                    </div>
                </p>
            </div>

            <div class="one" style="margin-right:2px;">
                <div class="shop_skin_index_list" rel="edit-t14" no="13">
                    <div class="img"></div>
                </div>
                <p class="name">
                	<div class="name shop_skin_index_list" rel="edit-t11" no="10">

                        <a class="div_typename div_font"></a>
                    </div>
                </p>
            </div>
        </div>
    </div><!--头部结束-->

	<script>
		$(document).ready(function(){
			var window_width=$(window).width();
		$(".newad img").css("width",window_width+"px");
		$(".newad img").css("height",window_width/2+"px");
		$(".banner img").css("width",window_width+"px");
		$(".banner img").css("height",window_width/2+"px");
		})
	</script>

    <div class="shop_skin_index_list" rel="edit-t02" no="1">
        <div class="img"></div>
    </div>

	<?php
		$tem_floor="select id,position from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=41 and isvalid=true and position >=15 and position <=17 order by position asc";
		$result_tem_floor=_mysql_query($tem_floor) or die ('tem_floor faild ' .mysql_error());
		while($row=mysql_fetch_object($result_tem_floor)){
			$position=$row->position;


	?>
		<div class="shop_skin_index_list newad" rel="edit-t<?php echo $position?>" no="<?php echo $position-1?>">
			<div class="img"></div>
		</div>

	<?php
		}
	?>

    <div class="shop_skin_index_list" rel="edit-t03" no="2">
        <div class="img"></div>
    </div>


    <?php
		$i=1;

    	$cat="select id,name,cat_index_imgurl,index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and parent_id <0 ";
		if($sort_str){
		 $cat =$cat.' order by field(id'.$sort_str.')';
		 }
		$result_cat=_mysql_query($cat) or die ("cat_query faild" .mysql_error());
		while($row=mysql_fetch_object($result_cat)){
			$cat_parid=$row->id;
			$cat_parname=$row->name;

			$cat_parimgurl=$row->cat_index_imgurl;
			$index_imgurl=$row->index_imgurl;
			$cat_adurl=$row->cat_adurl;


	?>

    <?php
		$catson_num="select count(1) as  cat_num from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and top_id=".$cat_parid."";
		$result_catson_num=_mysql_query($catson_num) or die ('catson_num faild' .mysql_error());
		while($row=mysql_fetch_object($result_catson_num)){
			$cat_num=$row->cat_num;
			}
	?>

    <?php if($cat_num){ ?><!--有子分类才显示-->
	<?php if($index_imgurl){?>
	 <div class="shop_skin_index_list cat_ad">
        <a href="<?php echo $cat_adurl?>"><img src="<?php echo $new_baseurl.$index_imgurl;?>"></a>
    </div>
    <?php }?>
    <div class="<?php if($cat_num<5){echo "two-shop";}else{echo "three-shop";}?>"><!--分类楼层开始-->

        <div class="left-box">

        	<div class="title" <?php if($i<=8){echo "style='background-image:url(../common/fengge41/images/floor_bg".$i.".png);'";}elseif($i>8){echo "style='background-image:url(../common/fengge41/images/floor_bg.png);'";}?>>
            	<span class="floor_num"><?php echo $i;?>F</span>
                <span class="floor_title"><?php echo $cat_parname;?></span>
            </div>

            <a href="../../mshop/list.php?tid=<?php echo $cat_parid; ?>&tname=<?php echo $cat_parname; ?>&customer_id=<?php echo $customer_id_en; ?>">
                <div class="big-box">


                    <img src="<?php echo $new_baseurl.$cat_parimgurl;?>" style="border:none">
                </div>
            </a>
        </div>

        <div class="right-box">
        	<?php

        	$cat_son="select id,name,cat_index_imgurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and top_id=".$cat_parid." order by id desc limit 0,6";
			$result_cat_son=_mysql_query($cat_son) or die ('cat_son_query faild' .mysql_error());
			while($row=mysql_fetch_object($result_cat_son)){
				$cat_sonid=$row->id;
				$cat_sonname=$row->name;

				$cat_sonimgurl=$row->cat_index_imgurl;

		?>
        	<a href="../../mshop/list.php?tid=<?php echo $cat_sonid; ?>&tname=<?php echo $cat_sonname; ?>&customer_id=<?php echo $customer_id_en; ?>">
                <div class="st-box">


                    <img src="<?php echo $new_baseurl.$cat_sonimgurl;?>">
                </div>
			</a>
        <?php }?>
        </div>
        <div class="clear"></div>
    </div><!--分类楼层结束-->
    <?php $i++;}?><!--有子分类才显示-->
    <?php }?>

    <div class="div-box"><!--全部商品开始-->
        <!--<div class="shop_skin_index_list" rel="edit-t05" no="04">
            <div class="img"></div>
        </div>
		-->

		<div class="shop_skin_index_list" rel="edit-t05" no="4">
            <div class="img"></div>
        </div>
        <div class="shop_skin_index_list" rel="edit-t06" no="5">
            <div class="img"></div>
        </div>

        <?php
			//显示热卖产品
			$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and ishot=true and isout=0 and customer_id=".$customer_id;
			if(!empty($owner_typeids)){
			 //查找自己微店的产品
				 $query = $query." and (";
				 $owner_typeids_arr = explode(",",$owner_typeids);
				 $owner_typeids_count = count($owner_typeids_arr);
				 for($j=0;$j<$owner_typeids_count;$j++){
					 $o_typeid = $owner_typeids_arr[$j];
					 if($j==0){
						$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
					 }else{
						$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
					 }
				 }
				 $query = $query.")";
			}
			$query= $query." order by asort_value desc,id desc";
			//echo $query;
			$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
			while ($row = mysql_fetch_object($result)) {
				$pid = $row->id;
				$pname = $row->name;
				$orgin_price = $row->orgin_price;
				$now_price = $row->now_price;
				$p_img = $row->default_imgurl;
				$type_ids =$row->type_ids;
				$pro_discount=$row->pro_discount;
				$sell_count =$row->sell_count;
				$show_sell_count =$row->show_sell_count;

				if(empty($p_img)){
					$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
					$p_img = "";
					while ($row2 = mysql_fetch_object($result2)) {
					$p_img= $row2->imgurl;
					}
				 }
		?>
        <div class="small-box">
            <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><img src="<?php echo $new_baseurl.$p_img;?>"></a>

            <span class="span1">原价:
			<?php if(OOF_P != 2) echo OOF_S ?>
			<?php echo $orgin_price;?>
			<?php if(OOF_P == 2) echo OOF_S ?>
			</span><span class="span2">
			<?php if(OOF_P != 2) echo OOF_S ?>
			<?php echo $now_price;?>
			<?php if(OOF_P == 2) echo OOF_S ?>
			</span>
            <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><button class="red-button">抢购</button></a>
        </div>

		<?php }?>
        <div class="clear"></div>
    </div><!--全部商品结束-->
		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
</div>
</div>
<script type="text/javascript">
		function chan(){
			$('.small-box').find('img').height($('.small-box').find('img').width());
		}
		chan();
		function getH(){
			$('.two-shop').each(function(){
				$(this).find('.left-box').find('.big-box img').height($(this).find('.right-box').height()-47);
				console.log($(this).find('.right-box').height());
			});
		}
		window.onload=function(){
			getH();
		}



</script>
<!-- 以上JS只用于41号模板 -->

<?php }else if($template_id==42){?>

<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	<div class="main">
        <div class="shop_skin_index_list" rel="edit-t01" no="0">
        	<div class="img"></div>
    	</div>
        <div class="search-box" style="display:block;position:relative">
			<img src="../common/fengge42/images/search.jpg" onclick="search_name();" style="width:25px;top:9px;left:47px;position:absolute;">
            <input type="text" class="search-input" id="searchname" name="searchname"  onkeydown="if(event.keyCode==13){search_name();}" placeholder="查找宝贝">

        </div>
        <div class="shop_skin_index_list banner"  rel="edit-t02" no="1">
            <div class="img"></div>

        </div>
        <div class="content-box">
            <div class="icon-box">
                <div class="shop_skin_index_list" rel="edit-t03" no="2">
                    <div class="img"></div>
                </div>
                <p>
                    <div class="name shop_skin_index_list" rel="edit-t11" no="10">
                        <div class="div_typename div_font" ></div>
                    </div>
                </p>
            </div>
            <div class="icon-box">
                <div class="shop_skin_index_list" rel="edit-t04" no="3">
                    <div class="img"></div>
                </div>
                <p>
                    <div class="name shop_skin_index_list" rel="edit-t12" no="11">
                        <div class="div_typename div_font" ></div>
                    </div>
                </p>
            </div>
            <div class="icon-box">
                <div class="shop_skin_index_list" rel="edit-t05" no="4">
                    <div class="img"></div>
                </div>
                <p>
                    <div class="name shop_skin_index_list" rel="edit-t13" no="12">
                        <div class="div_typename div_font" ></div>
                    </div>
                </p>
            </div>
            <div class="icon-box">
                <div class="shop_skin_index_list" rel="edit-t06" no="5">
                    <div class="img"></div>
                </div>
                <p>
                    <div class="name shop_skin_index_list" rel="edit-t14" no="13">
                        <div class="div_typename div_font" ></div>
                    </div>
                </p>
            </div>
            <div class="icon-box">
                <div class="shop_skin_index_list" rel="edit-t07" no="6">
                    <div class="img"></div>
                </div>
                <p>
                    <div class="name shop_skin_index_list" rel="edit-t15" no="14">
                        <div class="div_typename div_font" ></div>
                    </div>
                </p>
            </div>
            <div class="icon-box">
                <div class="shop_skin_index_list" rel="edit-t08" no="7">
                    <div class="img"></div>
                </div>
                <p>
                    <div class="name shop_skin_index_list" rel="edit-t16" no="15">
                        <div class="div_typename div_font" ></div>
                    </div>
                </p>
            </div>
            <div class="icon-box">
                <div class="shop_skin_index_list" rel="edit-t09" no="8">
                    <div class="img"></div>
                </div>
                <p>
                    <div class="name shop_skin_index_list" rel="edit-t17" no="16">
                        <div class="div_typename div_font" ></div>
                    </div>
                </p>
            </div>
            <div class="icon-box">
                <div class="shop_skin_index_list" rel="edit-t10" no="9">
                    <div class="img"></div>
                </div>
                <p>
                    <div class="name shop_skin_index_list" rel="edit-t18" no="17">
                        <div class="div_typename div_font" ></div>
                    </div>
                </p>
            </div>

            <div class="clear"></div>
        </div>
        <div class="dapai">
            <div class="left-box">
                <div class="shop_skin_index_list"  rel="edit-t19" no="18">
            		<div class="img"></div>
            	</div>
            </div>
            <div class="right-box">
                <div class="first-box">
                    <div class="shop_skin_index_list"  rel="edit-t20" no="19">
                        <div class="img"></div>
                    </div>
                </div>
                <div class="second-box">
                    <div class="shop_skin_index_list"  rel="edit-t21" no="20">
                        <div class="img"></div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>

        <div class="makeup">
                <div class="shop_skin_index_list"  rel="edit-t29" no="28" style="margin-top:5px;">
                    <div class="img"></div>
                </div>
                <div class="content-bg">
                <div class="content">
                    <div class="left-box">
                        <div class="top_box" >
                            <div class="shop_skin_index_list"  rel="edit-t35" no="34">
                                <div class="img"></div>
                            </div>
                        </div>
                        <div class="first-box">
                            <div class="shop_skin_index_list"  rel="edit-t30" no="29">
                                <div class="img"></div>
                            </div>
                        </div>
                        <div class="second-box">
                            <div class="shop_skin_index_list"  rel="edit-t31" no="30">
                                    <div class="img"></div>
                                </div>
                            </div>
                        <div class="third-box">
                            <div class="shop_skin_index_list"  rel="edit-t32" no="31">
                                <div class="img"></div>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="right-box">
                        <div class="first-box">
                            <div class="shop_skin_index_list"  rel="edit-t33" no="32">
                                    <div class="img"></div>
                                </div>
                            </div>
                        <div class="second-box">
                            <div class="shop_skin_index_list"  rel="edit-t34" no="33">
                                    <div class="img"></div>
                                </div>
                            </div>
                        <div class="clear"></div>
                    </div>
                    <div class="clear"></div>
                </div>
                </div>
            </div>


            <div class="new-product" >
                <div class="title">
                    <div class="name">近日新品</div>
                    <div class="look"><a href="../../mshop/list.php?isnew=1&customer_id=<?php echo $customer_id_en; ?>" style="font-size:16px;color:#fff;">查看全部>></a></div>
                </div>
                <div class="product-box">
                  <?php
				$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and isnew=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
				}
				$query= $query." order by asort_value desc,id desc limit 0,4";
				//echo $query;
				$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
					while ($row = mysql_fetch_object($result)) {
						$pid = $row->id;
						$pname = $row->name;
						$orgin_price = $row->orgin_price;
						$now_price = $row->now_price;
						$p_img = $row->default_imgurl;
						$type_ids =$row->type_ids;
						$pro_discount=$row->pro_discount;
						$sell_count =$row->sell_count;
						$show_sell_count =$row->show_sell_count;

						if(empty($p_img)){
							$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
							$p_img = "";
							while ($row2 = mysql_fetch_object($result2)) {
							$p_img= $row2->imgurl;
							}
						 }


				?>

                    <div class="one-box">
                        <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><img src="<?php echo $new_baseurl.$p_img;?>"></a>
                        <div class="name"><?php echo $pname;?></div>
                        <div class="price"><?php if(OOF_P != 2) echo OOF_S ?><?php echo $now_price;?><?php if(OOF_P == 2) echo OOF_S ?></div>
                        <div class="sale">已售：<?php echo $sell_count+$show_sell_count;?>笔</div>
                    </div>

                   <?php
								}

					?>

                    <div class="clear"></div>
                </div>
            </div>
           <!--产品分类结束-->

           <div class="new-product">
                <div class="title">
                    <div class="name">热销爆款</div>
                    <div class="look"><a href="../../mshop/list.php?ishot=1&customer_id=<?php echo $customer_id_en; ?>" style="font-size:16px;color:#fff;">查看全部>></a></div>
                </div>
                <div class="product-box">
                  <?php
				$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and ishot=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
				}
				$query= $query." order by asort_value desc,id desc limit 0,4";
				//echo $query;
				$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
					while ($row = mysql_fetch_object($result)) {
						$pid = $row->id;
						$pname = $row->name;
						$orgin_price = $row->orgin_price;
						$now_price = $row->now_price;
						$p_img = $row->default_imgurl;
						$type_ids =$row->type_ids;
						$pro_discount=$row->pro_discount;
						$sell_count =$row->sell_count;
						$show_sell_count =$row->show_sell_count;

						if(empty($p_img)){
							$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
							$p_img = "";
							while ($row2 = mysql_fetch_object($result2)) {
							$p_img= $row2->imgurl;
							}
						 }


				?>

                    <div class="one-box">
                        <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><img src="<?php echo $new_baseurl.$p_img;?>"></a>
                        <div class="name"><?php echo $pname;?></div>
                        <div class="price"><?php if(OOF_P != 2) echo OOF_S ?><?php echo $now_price;?><?php if(OOF_P == 2) echo OOF_S ?></div>
                        <div class="sale">已售：<?php echo $sell_count+$show_sell_count;?>笔</div>
                    </div>

                   <?php
								}

					?>

                    <div class="clear"></div>
                </div>
            </div>
           <!--产品分类结束-->

           <style>
            	.weidian .first img{width:70px!important;height:42px!important;}
            </style>

			<?php if($is_showbottom_menu){
			/*<style>
				.new-product{margin-bottom:50px;}
			</style>
            <div class="footer">
            <div class="footer-box">
                <div class="weidian active">

                    	<div class="shop_skin_index_list" rel="edit-t22" no="21">
                    		<div class="img first" ></div>
                    	</div>


                </div>
                <div class="weidian">

                    	<div class="shop_skin_index_list" rel="edit-t23" no="22">
                    		<div class="img"></div>
                    	</div>
                    	<p>
                        	<div class="name shop_skin_index_list" rel="edit-t26" no="25">
                        		<div class="div_font" ><a  href="#" class="div_typename"></a></div>
                        	</div>
                        </p>

                </div>
                <div class="weidian">

                    	<div class="shop_skin_index_list" rel="edit-t24" no="23">
                    		<div class="img"></div>
                    	</div>
                    	<p>
                        	<div class="name shop_skin_index_list" rel="edit-t27" no="26">
                        		<div class="div_font" ><a  href="#" class="div_typename"></a></div>
                        	</div>
                        </p>

                </div>
                <div class="weidian">

                    	<div class="shop_skin_index_list" rel="edit-t25" no="24">
                    		<div class="img"></div>
                    	</div>
                    	<p>
                        	<div class="name shop_skin_index_list" rel="edit-t28" no="27">
                        		<div class="div_font" ><a  href="#" class="div_typename"></a></div>
                        	</div>
                        </p>

                </div>
            </div>
            </div>*/
			/*判断是否显示底部菜单 start*/
			require_once('../../common/utility_setting_function.php');
			$fun = "index";
			$is_publish = check_is_publish(2,$fun,$customer_id);

			if($is_publish){
				require_once('../../mshop/bottom_label.php');
			}
			/*判断是否显示底部菜单 end*/
             }?>


        </div>
			  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>
        	<style>
				.new-product{margin-bottom:0px!important;}
			</style>
			<div class="" style="width:100%;display:block;margin-bottom:50px;margin-top:20px;padding-bottom:20px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
</div>

<?php }else if($template_id==43){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	<div class="main">
			<div class="header_3" style="background:#8D4E00;">
					<label style="color:#FEFFFC;">
						<i>
						<div class="shop_skin_index_list" rel="edit-t01" no="0">
							<div class="img" style=" border-radius:100px;"></div>
						</div>
						</i>
						<div class="name shop_skin_index_list title" rel="edit-t24" no="23">
							<div class="div_typename div_font" ></div>
						</div>
					</label>
			</div>
			<div class="shop_skin_index_list banner"  rel="edit-t02" no="1">
				<div class="img"></div>
			</div>
			<div class="widget_wrap icon_1">
				<ul>
						<li style="background:#F7F7F5" loop="1">
							<div class="shop_skin_index_list" rel="edit-t03" no="2">
								<div class="img"></div>
							</div>
						<div class="name shop_skin_index_list" rel="edit-t07" no="6">
							<div class="div_typename div_font" ></div>
						</div>
						</li>
						<li style="background:#F7F7F5" loop="1">
							<div class="shop_skin_index_list" rel="edit-t04" no="3">
								<div class="img"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t08" no="7">
								<div class="div_typename div_font" ></div>
							</div>
						</li>
						<li style="background:#F7F7F5" loop="1">
							<div class="shop_skin_index_list" rel="edit-t05" no="4">
								<div class="img"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t09" no="8">
								<div class="div_typename div_font" ></div>
							</div>
						</li>
						<li style="background:#F7F7F5" loop="1">
							<div class="shop_skin_index_list" rel="edit-t06" no="5">
								<div class="img"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t10" no="9">
								<div class="div_typename div_font" ></div>
							</div>
						</li>
				</ul>
			</div>
            <div Type="2" data-role="widget" data-widget="search_2" class="search_2">
				<div class="widget_wrap">
					<form action="#">
						<div>
							<input type="search" id="searchname" name="searchname" placeholder="输关键词找宝贝" />
						</div>
						<div>
							<img onclick="search_name();" src="../common/fengge43/images/widget_search_pic.png" />
						</div>
					</form>
				</div>
			</div>
            <div class="shop_skin_index_list" rel="edit-t11" no="10">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t12" no="11">
				<div class="img"></div>
			</div>

			<div Type="1" data-role="widget" data-widget="pic_1" class="pic_1">
			  <div class="widget_wrap">
			      <span class="ptype">热销产品</span>
				  <img src="../common/fengge43/images/line.png" />
				  <a href="../../mshop/list.php?ishot=1&customer_id=<?php echo $customer_id_en; ?>" style="font-size:18px;color:#fff;"><span class="more">more>></span></a>
			  </div>
			</div>
			<div Type="1" data-role="widget" data-widget="goodsList_1" class="goodsList_1">
				<div class="goods">
				<ul>
					 <?php
				$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and ishot=true and isout=0 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
				}
				$query= $query." order by asort_value desc,id desc limit 0,4";
				//echo $query;
				$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
					while ($row = mysql_fetch_object($result)) {
						$pid = $row->id;
						$pname = $row->name;
						$orgin_price = $row->orgin_price;
						$now_price = $row->now_price;
						$p_img = $row->default_imgurl;
						$type_ids =$row->type_ids;
						$pro_discount=$row->pro_discount;
						$sell_count =$row->sell_count;
						$show_sell_count =$row->show_sell_count;

						if(empty($p_img)){
							$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
							$p_img = "";
							while ($row2 = mysql_fetch_object($result2)) {
							$p_img= $row2->imgurl;
							}
						 }
				?>
					<li loop="1">

						<div class="goodlists">
							<div class="img_wrap">
								<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><img  src="<?php echo $new_baseurl.$p_img;?>" /></a>
								<!-- <span name="goodsdetailspan" class="tag">团购促销</span> -->
							</div>
							<div class="pname">
								<p class="title">
									<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>" title="<?php echo $pname;?>"><?php echo $pname;?></a>
								</p>
								<label class="price"><?php if(OOF_P != 2) echo OOF_S ?><?php echo $now_price;?><?php if(OOF_P == 2) echo OOF_S ?></label>

							</div>
						</div>

					</li>
					<?php }?>

				</ul>
				</div>
			</div>




			<?php
				//一级分类商品
				$cat_parid=-1;
				$cat="select id,name,cat_index_imgurl,index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and parent_id <0 ";
				if($sort_str){
					$cat =$cat.' order by field(id'.$sort_str.')';
				}
				$result_cat=_mysql_query($cat) or die ("cat_query faild" .mysql_error());
				$typeson_id=array();
				while($row=mysql_fetch_object($result_cat)){
					$cat_parid=$row->id;
					$cat_parname=$row->name;
					$cat_parimgurl=$row->cat_index_imgurl;
					$index_imgurl=$row->index_imgurl;
					$cat_adurl=$row->cat_adurl;


					$type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$cat_parid." and customer_id=".$customer_id."";
					$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
					while($row=mysql_fetch_object($result_typeson)){

					$typeson_id[]=$row->id;
					//$typeson_id1[]=$row->id;
					}

					array_push($typeson_id,$cat_parid);
					$typeson_id=implode(',',$typeson_id);

					$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;


					if(empty($typeson_id)){
						$typeson_id=$cat_parid;
					}
					$query = $query." and (";
					$typeson_id_arr = explode(",",$typeson_id);
					$typeson_id_count = count($typeson_id_arr);
					for($j=0;$j<$typeson_id_count;$j++){
						$o_typeid = $typeson_id_arr[$j];
						if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						}else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						}
					}
					$query = $query.")";

					if(!empty($owner_typeids)){
					//查找自己微店的产品
						$query = $query." and (";
						$owner_typeids_arr = explode(",",$owner_typeids);
						$owner_typeids_count = count($owner_typeids_arr);
						for($j=0;$j<$owner_typeids_count;$j++){
							$o_typeid = $owner_typeids_arr[$j];
							if($j==0){
								$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
							}else{
								$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
							}
						}
						$query = $query.")";
					}
					$query= $query." order by asort_value desc,id desc limit 0,6";
					//echo $query;
					$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
					$count = mysql_num_rows($result);

			?>
			<?php if($count>0){?>
				<div Type="1" data-role="widget" data-widget="pic_1" class="pic_1">
					<div class="widget_wrap">
						<span class="ptype"><?php echo $cat_parname;?></span>
						<img src="../common/fengge43/images/line.png" />
						<a href="../../mshop/list.php?tid=<?php echo $cat_parid; ?>&customer_id=<?php echo $customer_id_en; ?>"><span class="more">more>></span></a>
					</div>
				</div>
				<?php if(!empty($index_imgurl)){?><a href="<?php echo $cat_adurl;?>"><img class="TypeAD" src="<?php echo $new_baseurl.$index_imgurl;?>"></a><?php }?>
				<div Type="1" data-role="widget" data-widget="goodsList_1" class="goodsList_1">
					<div class="goods">
						<ul>
							<?php

							while ($row = mysql_fetch_object($result)) {
								$pid = $row->id;
								$pname = $row->name;
								$orgin_price = $row->orgin_price;
								$now_price = $row->now_price;
								$p_img = $row->default_imgurl;
								$type_ids =$row->type_ids;
								$pro_discount=$row->pro_discount;
								$sell_count =$row->sell_count;
								$show_sell_count =$row->show_sell_count;

								if(empty($p_img)){
									$query4 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
									$result4 = _mysql_query($query4) or die('Query failed3: ' . mysql_error());
									$p_img = "";
									while ($row4 = mysql_fetch_object($result4)) {
										$p_img= $row4->imgurl;
									}
								}

							?>
							<li loop="1">

								<div class="goodlists">
									<div class="img_wrap">
										<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><img  src="<?php echo $new_baseurl.$p_img;?>" /></a>
									<!-- <span name="goodsdetailspan" class="tag">团购促销</span> -->
									</div>
									<div class="pname">
										<p class="title">
										<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>" title="<?php echo $pname;?>"><?php echo $pname;?></a>
										</p>
										<label class="price"><?php if(OOF_P != 2) echo OOF_S ?><?php echo $now_price;?><?php if(OOF_P == 2) echo OOF_S ?></label>

									</div>
								</div>

							</li>
							<?php }?>
						</ul>
					</div>
				</div>

			<?php }unset($typeson_id);
				}
			?>



			<div class="shop_skin_index_list" rel="edit-t13" no="12">
				<div class="img"></div>
			</div>
			<style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
		<?php if($is_showbottom_menu){
			/*<div data-role="widget" data-widget="menu_2" class="menu_2">
				<div class="widget_wrap icon_1">
					<ul>

						<li style="background: #F7F7F5">
							<div class="shop_skin_index_list" rel="edit-t14" no="13">
								<div class="img foot"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t19" no="18">
								<div class="div_typename div_font" ></div>
							</div>
						</li>

						<li style="background: #F7F7F5">
							<div class="shop_skin_index_list" rel="edit-t15" no="14">
								<div class="img foot"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t20" no="19">
								<div class="div_typename div_font" ></div>
							</div>
						</li>

						<li style="background: #F7F7F5">
							<div class="shop_skin_index_list" rel="edit-t16" no="15">
								<div class="img foot"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t21" no="20">
								<div class="div_typename div_font" ></div>
							</div>
						</li>

						<li style="background: #F7F7F5">
							<div class="shop_skin_index_list" rel="edit-t17" no="16">
								<div class="img foot"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t22" no="21">
								<div class="div_typename div_font" ></div>
							</div>
						</li>

						<li style="background: #F7F7F5">
							<div class="shop_skin_index_list" rel="edit-t18" no="17">
								<div class="img foot"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t23" no="22">
								<div class="div_typename div_font" ></div>
							</div>
						</li>

					</ul>
				</div>
			</div>*/
			/*判断是否显示底部菜单 start*/
			require_once('../../common/utility_setting_function.php');
			$fun = "index";
			$is_publish = check_is_publish(2,$fun,$customer_id);

			if($is_publish){
				require_once('../../mshop/bottom_label.php');
			}
			/*判断是否显示底部菜单 end*/
		 }?>
    </div>
</div>
	<div id="tools_widget" class="tools_widget" data-tools="tools_widget" data-widget="tools" >
		<div class="widget_wrap1">
			<ul class="tools_widget_wrap">
				<li>
					<a id="tools_widget_goTop" class="tools_widget_goTop" style="display:none;" href="javascript:scroll(0,0);">顶部</a>
				</li>
			</ul>
		</div>
	</div>
	<script>
		function rightBar() {
			$(window).scroll(function () {
				var scroll_top = $(document).scrollTop();
				if (scroll_top != 0) {
					$("#tools_widget_goTop").show();}
				  else
					   {$("#tools_widget_goTop").hide();}
			});
			$("#tools_widget_goTop").click(function () {
				location.hash = "top";
				$("#tools_widget_goTop").hide();
			});
		}
        rightBar();



	$(function(){
		$(window).resize(function(){
			var $iw=$('.goodlists img').width();
			$('.goodlists img').height($iw);
		});
		$(window).resize();
	});
   </script>



<?php }else if($template_id==44){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
    <div class="header" style="padding:0px;max-height:454px;max-width:1024px;">
    	<div class="shop_skin_index_list banner"  rel="edit-t01" >
        	<div class="img" ><div class="slider"><div class="flexslider">
				<div class="flex-viewport" style="overflow: hidden; position: relative;">
					<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-3789px, 0, 0);">
						<li class="clone" style="float: left; display: block;">
							<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>"></a>
						</li>
					</ul>
				</div></div></div>
			</div>
        </div>
    </div>
	<script>
	$(document).ready(function(){
	var window_height=$(window).height();
	var window_width=$(window).width();
	var window_width1=$(window).width();
	var header =$(".header");
	var header_height =window_height/2;
	var shouhou_width =window_width;
	var shouhou_height =window_width/3.2;

	var brand_img_width =window_width1/2;
	var brand_img_height =window_width1/4;
	header.css("height",header_height+"px");

	$(".shouhou_img img").css("width",shouhou_width+"px");
	$(".shouhou_img img").css("height",shouhou_height+"px");
	$(".brand_img").css("width",brand_img_width+"px");
	$(".brand_img").css("height",brand_img_height+"px");

	$(".mp-hotlist-img img").css("width",window_width/2+"px");
	$(".mp-hotlist-img img").css("height",window_width/2+"px");



	});
	</script>
 	<div class="marquee shop_skin_index_list"  rel="edit-t18" no="17">
		<marquee scrollamount="2">
		<div class="div_typename r_color" style="color:#e60014"></div>
		</marquee>
	</div>
    <div id="app-field-model-page-1" style="width:100%">

        <div class="app-field clearfix clearfix_list b_white app-preview-anmin"><!--icon开始-->
            <div style="height: 10px;"></div>

            <div style="width:25%;float:left;text-align:center;">
              <div class="shop_skin_index_list" rel="edit-t02" no="1">
                  <div class="img"></div>
              </div>
               <div class="name shop_skin_index_list" rel="edit-t10" no="10">
                  <div class="div_typename r_color"></div>
              </div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t03" no="2" >
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t11" no="10">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t04" no="3">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t12" no="11">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
               <div class="shop_skin_index_list" rel="edit-t05" no="4">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t13" no="12">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t06" no="5">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t14" no="13">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t07" no="6">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t15" no="14">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t08" no="7">
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t16" no="15">
						<div class="div_typename r_color"></div>
					</div>
            </div>
            <div style="width:25%;float:left;text-align:center;">
                <div class="shop_skin_index_list" rel="edit-t09" no="8" >
					<div class="img"></div>
					</div>
                     <div class="name shop_skin_index_list" rel="edit-t17" no="16">
						<div class="div_typename r_color"></div>
					</div>
            </div>
    	</div>      <!--icon结束-->
        <div class="shop_skin_index_list" rel="edit-t31" no="30"><!--添加视频-->
			<div class="div_typevideo"></div>
		</div>


        <div style="height:5px;display:block;"></div>
            <div class="shop_skin_index_list banner " rel="edit-t19" no="18">
                <div class="img shouhou_img"></div>
            </div>
        	<div class="shop_skin_index_list banner" rel="edit-t20" no="19">
                <div class="img shouhou_img"></div>
            </div>

			 <?php  //分类
			    $query="";
				if($is_shopgeneral){
				   $query= "select * from weixin_commonshop_types where isvalid=true and parent_id=-1 and is_shelves=true and customer_id=".$customer_id."";
				}else{
				   $query= "select * from weixin_commonshop_types where isvalid=true and parent_id=-1 and is_shelves=true and customer_id=".$customer_id;

				}
				if($sort_str){
				 $query =$query.' order by field(id'.$sort_str.')';
				 }
				$result = _mysql_query($query) or die('Query failed: ' . mysql_error());
				$data=array();
				$data1=array();
				$j=0;
				while ($row = mysql_fetch_object($result)) {
					$pt_id = $row->id;
					$pt_name = $row->name;
					$i=0;

					$query1= "select * from weixin_commonshop_types where isvalid=true and top_id=".$pt_id." and customer_id=".$customer_id;
					if(!empty($owner_typeids)){
						$query1 = $query1." and id in(".$owner_typeids.")";
					}
					if($is_shopgeneral){
					   $query1=$query1." order by create_type asc";
					}

					$result1 = _mysql_query($query1) or die('Query failed: ' . mysql_error());
					$count1 = mysql_num_rows($result1);

					if($count1>0){
						$data1[$j]['gc_id'] = $pt_id;
						$data1[$j]['gc_name'] = $pt_name;
						$data2=array();
						$sql= "select * from weixin_commonshop_types   where isvalid=true and top_id=".$pt_id." and customer_id=".$customer_id ;
						if(!empty($owner_typeids)){
							$sql = $sql." and id in(".$owner_typeids.")";
						}
						if($is_shopgeneral){
						   $sql=$sql." order by create_type asc";
						}else{
						   $sql = $sql." order by id desc limit 6";
						}
						//$result2 = _mysql_query($sql) or die('Query failed: ' . mysql_error());
						$result3 = _mysql_query($sql) or die('Query failed: ' . mysql_error());
							?>

			<div class="app-field clearfix clearfix_list  b_white app-preview-anmin" style="border-bottom:1px dashed #999;padding-bottom:4px;margin-bottom:5px;"><!--分类楼层开始-->
				  <div style="height:10px"></div>
				  <div style="width:100%;background-color:#fff">
					  <div style="height:5px"></div>
						  <a href="../../mshop/list.php?tid=<?php echo $pt_id; ?>&tname=<?php echo $pt_name; ?>&customer_id=<?php echo $customer_id_en; ?>" style="display:block;">
						  <div class="brand_head">
							  <span class="cat_name"><?php echo $pt_name ?></span>
							  <span class="more">更多>></span>
						  </div>
						  </a>
						  <div style="height:5px"></div>
						  <div class="brand_list">
							<ul>
								<?php
								  while ($row3 = mysql_fetch_object($result3)) {
									$pt_id2 = $row3->id;

									$pt_imgurl = $row3->imgurl;
									$pt_name2 = $row3->name;
									$data2[$i]['gb_id'] = $pt_id2;
									$data2[$i]['gb_logo'] = $new_baseurl.$pt_imgurl;
									$data2[$i]['gb_name'] = $pt_name2;

									?>
								<li>
									<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en;?>&tid=<?php echo $pt_id2;?>&tname=<?php echo $pt_name2;?>">
									<img src="<?php echo $data2[$i]['gb_logo']?>" class="brand_img">
									</a>
								</li>
								<?php
											$i++;
										}
										$data1[$j]['brandinfo'] = $data2;
									$j++;
										  ?>
							</ul>
						  </div>

				   </div>
				</div>
				<?php     }
			        }

				?>


            <div class="shop_skin_index_list banner" rel="edit-t22" no="21">
                <div class="img shouhou_img"></div>
            </div>

            <div class="app-field clearfix clearfix_list  b_white app-preview-anmin"><!--搜索开始-->
                <div class="custom-search">
                  <form>
                    <input type="search" class="custom-search-input" placeholder="商品搜索：请输入商品关键字" name="searchname"  id="searchname" value="" onkeydown="javascript:if(event.keyCode==13){search_name();return false;}">
                    <button type="button" onclick="search_name()" class="custom-search-button">搜索</button>
                  </form>
            	</div>
         	</div>

			<div style="display:block;position:relative;margin-top:10px;">
				<ul>
				<?php

					$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count,introduce from weixin_commonshop_products where ishot=true and isvalid=true and isout=0 and customer_id=".$customer_id."";
					if(!empty($owner_typeids)){
					 //查找自己微店的产品
						 $query = $query." and (";
						 $owner_typeids_arr = explode(",",$owner_typeids);
						 $owner_typeids_count = count($owner_typeids_arr);
						 for($j=0;$j<$owner_typeids_count;$j++){
							 $o_typeid = $owner_typeids_arr[$j];
							 if($j==0){
								$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }else{
								$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }
						 }
						 $query = $query.")";
					}

					$query= $query." order by asort_value desc,id desc limit 0,6";
					//echo $query;
					$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
						while ($row = mysql_fetch_object($result)) {
							$pid = $row->id;
							$pname = $row->name;
							$orgin_price = $row->orgin_price;
							$now_price = $row->now_price;
							$p_img = $row->default_imgurl;
							$type_ids =$row->type_ids;
							$pro_discount=$row->pro_discount;
							$sell_count =$row->sell_count;
							$show_sell_count =$row->show_sell_count;
							$introduce= $row->introduce;

							if(empty($p_img)){
								$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
								$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
								$p_img = "";
								while ($row2 = mysql_fetch_object($result2)) {
								$p_img= $row2->imgurl;
								}
							 }

			?>
						<li class="" style="float:left;">
							<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id; ?>" class="mp-fulllink">
								<div class="mp-hotlist-img">
									<img src="<?php echo $new_baseurl.$p_img;?>">
								</div>
							</a>
						</li>
						<?php }?>
					</ul>

					<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>" style="width: 100%;display: block;float: left;text-align: center;height: 30px;background-color: #ddd;font-size:14px;line-height:30px;">查看所有产品</a>
				</div>






            <style>
  	.foot_img img {width:60px;}
  </style>
   <?php


			if($supportname){

		?>
        	<style>
				.custom-search{margin-bottom:0px!important;}
			</style>
			<div class="" style="width:100%;display:block;margin-bottom:49px;float:left;margin-top:20px;padding-bottom:20px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
        <?php if($is_showbottom_menu){
			/*<div  class="clear"></div>
            <div class="button_tab_menu">
                <!--distribution contact us end-->
                <dl class="sub-nav nav-b5">
                    <dd class="active">
                        <div class="nav-b5-relative shop_skin_index_list" rel="edit-t23" no="22"><div class="img"></div></div><div class="name shop_skin_index_list" rel="edit-t27" no="26">
                    <div class="div_typename div_font" style="color:#2b9939"></div>
                </div>
                    </dd>
                    <dd>
                          <div class="nav-b5-relative shop_skin_index_list" rel="edit-t24" no="23"><div class="img"></div></div><div class="name shop_skin_index_list" rel="edit-t28" no="27">
                    <div class="div_typename div_font" ></div>
                </div>
                    </dd>
                    <dd>
                          <div class="nav-b5-relative shop_skin_index_list" rel="edit-t25" no="24"><div class="img"></div></div><div class="name shop_skin_index_list" rel="edit-t29" no="28">
                    <div class="div_typename div_font" ></div>
                </div>
                    </dd>
                    <dd>
                          <div class="nav-b5-relative shop_skin_index_list" rel="edit-t26" no="25"><div class="img"></div></div><div class="name shop_skin_index_list" rel="edit-t30" no="29">
                    <div class="div_typename div_font" ></div>
                </div>
                    </dd>
                </dl>
			</div>*/
		 }?>
    </div>
</div>

<?php }else if($template_id==45){?>
<style>
#bottom_footer{position:fixed;z-index:1000;bottom:0;background:#f9f9f9;width:100%;height:50px;border-top:2px solid #c9c9c9;box-sizing:border-box;}
#bottom_footer div .foot{float:left;text-align:center;height:50px;line-height:50px;}
.arrow_weixin{background: url("./images/textmenuicon.png") no-repeat scroll 0 0;width:15px;height: 15px;background-size: 15px 15px;font-size: 14px;line-height: 45px;display: inline-block;vertical-align: middle;}
.submenu{position:absolute;padding:5px 8px;background:#eaeaea;text-align:center;border-radius:5px;font-size:14px;line-height:41px;z-index:11;background-color:#fafafa;bottom:56px;border:1px solid #ccc;}
.arrow{position: absolute;z-index: 11;border-right: 6px solid transparent;border-left: 6px solid transparent;border-bottom:0px none;}
.line-divide{border-top: 2px solid #e5e5e5;}
#bottom_footer .wid a:hover{text-decoration:none;color:#333;}
</style>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
		<div class="shop_skin_index_list" id="firpic" rel="edit-t01" no="0" style="width:100%;">
			<div class="img"></div>
			<div class="mod" style="display: none;">&nbsp;</div>

		</div>
		<div class="title shop_skin_index_list" rel="edit-t02" no="1" >
			<div class="div_typename"></div>
		</div>

		<ul class=" custom-coupon" style="float:left;">
            <li>
				<div class="shop_skin_index_list custom-coupon-price" rel="edit-t03" no="2" style="float:none;">
					<a class="div_typename" style="font-weight: bold;"></a>
				</div>
				<div class="shop_skin_index_list custom-coupon-desc" rel="edit-t04" no="3" style="float:none;">
					<a class="div_typename" ></a>
				</div>
            </li>
            <li>
				<div class="shop_skin_index_list custom-coupon-price" rel="edit-t05" no="4" style="float:none;">
					<a class="div_typename" style="font-weight: bold;"></a>
				</div>
				<div class="shop_skin_index_list custom-coupon-desc" rel="edit-t06" no="5" style="float:none;">
					<a class="div_typename" ></a>
				</div>
            </li>
            <li>
				<div class="shop_skin_index_list custom-coupon-price" rel="edit-t07" no="6" style="float:none;">
					<a class="div_typename" style="font-weight: bold;"></a>
				</div>
				<div class="shop_skin_index_list custom-coupon-desc" rel="edit-t08" no="7" style="float:none;">
					<a class="div_typename" ></a>
				</div>
            </li>
        </ul>
		<div class="notice shop_skin_index_list " rel="edit-t09" no="8" >
			<div class="div_typename js-scroll-notice notice"></div>
		</div>
		<div>
			<div class="shop_skin_index_list i0" rel="edit-t10" no="9">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i0" rel="edit-t11" no="10">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i0" rel="edit-t12" no="11">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i0" rel="edit-t13" no="12">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
		</div>
		<div class="shop_skin_index_list" rel="edit-t14" no="13">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
		</div>
		<div class="shop_skin_index_list banner" id="banpic" rel="edit-t15" no="14" >
			<div class="img"><div class="slider">
			<div class="flexslider">
			<div class="flex-viewport" style="overflow: hidden; position: relative;">
			<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-2526px, 0, 0);"><li class="clone" style="width: 1263px; float: left; display: block;"><a href="#/api/c209e836af/shop/products/2066/">
			</a></li></ul></div></div></div></div>
		</div>
		<div class="shop_skin_index_list" style="width: 100%;">
			<hr style="border-top: 1px;border-top: 1px dashed #bbb;">
		</div>
		<div class="shop_skin_index_list" rel="edit-t16" no="15">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
		</div>
		<div class="shop_skin_index_list" rel="edit-t17" no="16">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
		</div>
		<div>
			<div class="shop_skin_index_list i2" rel="edit-t18" no="17">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i2" rel="edit-t19" no="18">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
		</div>
		<div class="shop_skin_index_list" style="width: 100%;">
			<hr style="border-top: 1px;border-top: 1px dashed #bbb;">
		</div>
		<script>
			$(document).ready(function(){
			var window_width=$(window).width();
			$(".members_co1 img").css("width",window_width+"px");
			$(".members_co1 img").css("height",window_width*11/64+"px");
			});
		</script>

        <div class="margin" style="margin-bottom:5px;float:left;"><!--分类楼层开始-->
			<?php
            $query1="select id,index_imgurl,index_catnum from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
            if(!empty($owner_typeids)){
                $query1 = $query1." and id in (".$owner_typeids.")";
            }
            $query1=$query1." order by id desc";
            $result1 = _mysql_query($query1) or die('Query failed: ' . mysql_error());
            while ($row = mysql_fetch_object($result1)) {
                $tid = $row->id;
                $index_imgurl = $row->index_imgurl;
                $index_catnum = $row->index_catnum;
                $type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
				$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
				while($row=mysql_fetch_object($result_typeson)){

					$typeson_id[]=$row->id;
					//$typeson_id1[]=$row->id;
				}


                if(!empty($index_imgurl)){
            ?>
            <section class="members_goodspic">
                <ul>
                    <div class="members_con members_co1" style="margin:0px!important">
                        <div class="shop_skin_index_list">
                            <div class="img">
                                <a href="../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>"><img src="<?php echo $new_baseurl.$index_imgurl;?>"></a>
                            </div>
                        </div>
                    </div>
                    <?php
			array_push($typeson_id,$tid);
			$typeson_id=implode(',',$typeson_id);
            $query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id;

			if(empty($typeson_id)){
				$typeson_id=$tid;
			}
				$query = $query." and (";
				$typeson_id_arr = explode(",",$typeson_id);
				$typeson_id_count = count($typeson_id_arr);
				for($j=0;$j<$typeson_id_count;$j++){
					$o_typeid = $typeson_id_arr[$j];
					if($j==0){
						$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						}else{
						$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
					}
				}
				$query = $query.")";
            if(!empty($owner_typeids)){
             //查找自己微店的产品
                 $query = $query." and (";
                 $owner_typeids_arr = explode(",",$owner_typeids);
                 $owner_typeids_count = count($owner_typeids_arr);
                 for($j=0;$j<$owner_typeids_count;$j++){
                     $o_typeid = $owner_typeids_arr[$j];
                     if($j==0){
                        $query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
                     }else{
                        $query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
                     }
                 }
                 $query = $query.")";
            }
            $query= $query." order by asort_value desc,id desc limit 0,".$index_catnum."";
            //echo $query;
            $result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
                while ($row = mysql_fetch_object($result)) {
                    $pid = $row->id;
                    $pname = $row->name;
                    $orgin_price = $row->orgin_price;
                    $now_price = $row->now_price;
                    $p_img = $row->default_imgurl;
                    $type_ids =$row->type_ids;
                    $pro_discount=$row->pro_discount;
                    $sell_count =$row->sell_count;
                    $show_sell_count =$row->show_sell_count;

                    if(empty($p_img)){
                        $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
                        $result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
                        $p_img = "";
                        while ($row2 = mysql_fetch_object($result2)) {
                        $p_img= $row2->imgurl;
                        }
                     }


        ?>
                  <li class="mingoods">
                      <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
                          <img class="lazy" src="<?php echo $new_baseurl.$p_img;?>" data-original="<?php echo $new_baseurl.$p_img;?>" width="100%" style="display: inline;/*margin:0 9px;*/">
                      </a>
                      <span class="goods-title"><a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>" style="font-size:12px;display:block;overflow:hidden;height:16px;"><?php echo $pname;?></a></span>
                      <span class="price">
					  <?php if(OOF_P != 2) echo OOF_S ?>
					  <?php echo $now_price;?>
					  <?php if(OOF_P == 2) echo OOF_S ?>
					  </span>
                      <a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><div class="buy_btn"><div class="buy_btn"><input type="button" value="立即购买" class="buynow_btn"></div></div></a>
                  </li>
                    <?php }?>
                </ul>
            </section>
            <?php }unset($typeson_id);}?>
        </div> <!--产品分类结束-->
			<div id="footer_points"></div>
			<?php if($is_showbottom_menu){
				/*<footer id="bottom_footer">
				<div>
					<div class="home foot" style="width:16%;border-right:1px solid #ccc;">
						<a href="index.php" style="background:#F9F9F9;"><img src="images/ico_home.png" style="width: 30px;height:30px;margin-top:10px;"></a>
					</div>
					<?php
						$result=_mysql_query("select count(1) as ccount from weixin_commonshop_userdefined_nav where isvalid=true and customer_id=".$customer_id) or die('Query failed_nav1:'.mysql_error());
						while($row=mysql_fetch_object($result)){
							$ccount=$row->ccount;
						}
						$j=1;
						$chk_submenu=0;
						$result=_mysql_query("select name,chk_submenu,navigation_link,subpros,sublinks from weixin_commonshop_userdefined_nav where isvalid=true and customer_id=".$customer_id) or die('Query failed_nav1:'.mysql_error());
						while($row=mysql_fetch_object($result)){
							$name=$row->name;
							$chk_submenu=$row->chk_submenu;
							$navigation_link=$row->navigation_link;
							$subpros=$row->subpros;
							$sublinks=$row->sublinks;

						$pro_separate=explode("#",$subpros);
						$links_separate=explode("#",$sublinks);
						$count=count($pro_separate);
						if($j!=$ccount){
					?>
					<div class="foot wid" style="border-right:1px solid #ccc;">
						<a href="<?php echo $navigation_link?$navigation_link:"##";?>"><i class="arrow_weixin"></i><span><?php echo $name;?></span>
						</a>
						<?php if($chk_submenu==1){ ?>
						<!--子菜单-->
						<div class="submenu" style="display:none;">
							<span class="arrow" style="right:auto;border-top:6px solid #ccc;bottom: -6px;"></span>
							<span class="arrow" style="right:auto;border-top:6px solid #fafafa;bottom: -5px;"></span>
							<ul>
							<?php for($i=1;$i<=$count;$i++){
							?>
								<li>
                                    <a href="<?php echo $links_separate[$i-1];?>"><?php echo $pro_separate[$i-1];?></a>
                                </li>
								<?php if($i!=$count){ ?><li class="line-divide"></li><?php } ?>
							<?php  } ?>
							</ul>
						</div>
						<?php } ?>
					</div>
						<?php }else{ ?>
							<div class="foot wid" >
								<a href="<?php echo $navigation_link?$navigation_link:"##";?>"><i class="arrow_weixin"></i><span><?php echo $name;?></span>
								</a>
								<?php if($chk_submenu==1){ ?>
								<!--子菜单-->
								<div class="submenu" style="display:none;">
									<span class="arrow" style="right:auto;border-top:6px solid #ccc;bottom: -6px;"></span>
									<span class="arrow" style="right:auto;border-top:6px solid #fafafa;bottom: -5px;"></span>
									<ul>
									<?php for($i=1;$i<=$count;$i++){?>
										<li>
											<a href="<?php echo $links_separate[$i-1];?>"><?php echo $pro_separate[$i-1];?></a>
										</li>
										<?php if($i!=$count){ ?><li class="line-divide"></li><?php } ?>
									<?php  } ?>
									</ul>
								</div>
								<?php } ?>
							</div>
						<?php } $j++;} ?>
				</div>
			   </footer>*/
			   /*判断是否显示底部菜单 start*/
				require_once('../../common/utility_setting_function.php');
				$fun = "index";
				$is_publish = check_is_publish(2,$fun,$customer_id);

				if($is_publish){
					require_once('../../mshop/bottom_label.php');
				}
				/*判断是否显示底部菜单 end*/
		    } ?>

		<style>
			.foot_img img {width:60px;}
		</style>
		<?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;height:72px;position:relative;bottom:28px;padding-bottom:14px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>

                    <div style="text-align:center;width:100%;padding-top:20px;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>


	</div>


<script>
$(document).ready(function(){
	var submenu_count=<?php echo $ccount;?>;
	var foot_width=(81/submenu_count)+"%";
	$('.wid').width(foot_width);
})
$('.foot').click(function(){
	var foot_w=$(this).width();
	//var foot_c=(foot_w-16)/2
	$(this).children('div').width(foot_w-16);
	$(this).children('div').children(".arrow").css("left",((foot_w-16)/2)+"px");
	$(this).children('div').toggle();
	$(this).siblings().children('div').hide();
})
		var e = $(".js-scroll-notice");
		e.length && e.each(function() {
		function e() {
			i--, 0 > i + t && (i = o), n.css({
				left: i
			})
		}
		var n = $(this),
			t = n.width(),
			o = t,
			i = 0;
		 n.css({
			position: "relative"
		}), setInterval(e, 25)
	})

var window_width=$(window).width();
var fir_width=window_width/2.5;
//$("#firpic").css("height",fir_width);
var ban_width=window_width/2;
$("#banpic").css("height",ban_width);
var propic_width=$("#propic").width();
var propic=propic_width/1.5;
$("#propic").css("height",propic);
</script>

<?php }else if($template_id==46){
/*$city_id="";
$city_id=$_GET["city_id"];
if($city_id){
$city="select city from weixin_commonshop_product_area where  isvalid=true and id='".$city_id."' and customer_id=".$customer_id."";
$result_city=_mysql_query($city) or die ('city_hot faild' .mysql_error());
while($row=mysql_fetch_object($result_city)){
	$city=$row->city;
}
}
*/
//该模板有定位，当是h5小程序跳转过来，引入定位文件
if(isset($_SESSION["from_type_mini_".$customer_id])){
   $from_type_mini = (int)$_SESSION["from_type_mini_".$customer_id];

   if($from_type_mini == 5){
     require_once($_SERVER['DOCUMENT_ROOT'].'/mp/geolocation.php');
   }  
}
$city_id="";
$city_name="";
$city_id=$_GET["city_id"];
$city_name=$_GET["city_name"];

if(empty($city_name) && isset($_SESSION['city_name'])){
  $city_name = $_SESSION['city_name'];
}

//echo $_POST['loca_city']."2222";
/*if($city_id ){
	//echo $_COOKIE['city_name']=$_GET["city_name"];

	$city="select city from weixin_commonshop_product_area where  isvalid=true and id='".$city_id."' and customer_id=".$customer_id."";
	$result_city=_mysql_query($city) or die ('city_hot faild' .mysql_error());
	while($row=mysql_fetch_object($result_city)){
		$_COOKIE['city_name']=$row->city;
	}

}else{
	$_COOKIE['city_name']=$city_name;

}
$city=$_COOKIE['city_name'];*/
if(!$city_id){ //如果客户没有选择地区，就定位
	$cid_query="select id from weixin_commonshop_product_area where  isvalid=true and city like '%".$city_name."%' and customer_id=".$customer_id." limit 0,1";
	$result_cid=_mysql_query($cid_query) or die ('city_query' .mysql_error());
	while($row=mysql_fetch_object($result_cid)){
		$city_id=$row->id;
	}
	$_COOKIE['city_name']=$city_name;
}else{ //客户有选择地区

	$city="select city from weixin_commonshop_product_area where  isvalid=true and id='".$city_id."' and customer_id=".$customer_id."";
	$result_city=_mysql_query($city) or die ('city_hot faild' .mysql_error());
	while($row=mysql_fetch_object($result_city)){
		//$city=$row->city;
		$_COOKIE['city_name']=$row->city;
	}
	//$_SESSION["city_id"]=$city_id;
}
$_SESSION["city_id"]=$city_id;
$city=$_COOKIE['city_name'];
//echo $city1;
//echo $city;
?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	<div class="mp-page1" id="main-page1">
		<header class="mpg-navbar">
			<div class="mpg-nav-wrap-left">
				<div class="mpg-nav-wrap-left">
					<a class="mpg-header-back text-icon"  id="msgoback"></a>
				</div>
			</div>
			<div class="mpg-box-search">
				<a class="mpg-linkarea">
					<?php
						$query="select title from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=46 and position=20";
						$result=_mysql_query($query) or die ('query faild' .mysql_error());
						while($row=mysql_fetch_object($result)){
							$title=$row->title;
						}
						if(empty($title)){
							$title="输入城市/景点/游玩主题";
						}
					?>
					<input type="text" class="search-input" id="searchname" name="searchname"  onclick="search_name();" style="width:99%;height:99%;"placeholder="<?php echo $title;?>">
					<!--<span class="single-line"></span>-->
				</a>
			</div>
			<div class="mpg-nav-wrap-right">
				<a href="select-city.php?&customer_id=<?php echo $customer_id_en; ?>" class="mpg-linkarea">
					<span class="nav-city" style="color:#fff;"><?php if($city){echo $city;}else{echo "北京";}?><i class="text-icon"></i></span>
				</a>
			</div>
		</header>

	    <div class="mp-main" id="mp-main">
			<div class="mp-image-container">
				<div id="img-slider" class="mpw-swipe" data--swipe="[object Object]" style="visibility: visible;">
					<div class="mpw-swipe-wrap">
						<div class="shop_skin_index_list banner"  rel="edit-t01" no="0">
							<div class="img" id="lunbo"></div>
							<div class="mod" style="display: none;">&nbsp;</div>
						</div>
					</div>
				</div>
			</div>

			<div class="mp-category-container mpw-swipe" id="category-container" data--swipe="[object Object]" style="visibility: visible;">
				<div class="mpw-swipe-wrap">
					<div class="mpw-swipe-item">

						<div class="mp-category-item">
							<a href="select-city.php?&customer_id=<?php echo $customer_id_en; ?>">
							<div class="shop_skin_index_list" rel="edit-t02" no="1">
								<div class="img locationimg" ></div>

							</div>
							</a>
							<div class="name shop_skin_index_list" rel="edit-t10" no="9">
								<p class="keywords"><div class="div_typename"></div></p>
							</div>

						</div>

						 <script>
							$(document).ready(function(){
								$('.locationimg a').attr('href','select-city.php?&customer_id=<?php echo $customer_id_en; ?>');
								//alert(111);
							});
						 </script>

						<div class="mp-category-item">
							<div class="shop_skin_index_list" rel="edit-t03" no="2">
								<div class="img"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t11" no="10">
							   <p class="keywords"><a class="div_typename div_font"></a></p>
							</div>

						</div>
						<div class="mp-category-item">
							<div class="shop_skin_index_list" rel="edit-t04" no="3">
								<div class="img"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t12" no="11">
								<p class="keywords"><a class="div_typename div_font"></a></p>
							</div>

						</div>
						<div class="mp-category-item">
							<div class="shop_skin_index_list" rel="edit-t05" no="4">
								<div class="img"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t13" no="12">
								<p class="keywords"><a class="div_typename div_font"></a></p>
							</div>

						</div>
						<div class="mp-category-item">
							<div class="shop_skin_index_list" rel="edit-t06" no="5">
								<div class="img"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t14" no="13">
								<p class="keywords"><a class="div_typename div_font"></a></p>
							</div>

						</div>
						<div class="mp-category-item">
							<div class="shop_skin_index_list" rel="edit-t07" no="6">
								<div class="img"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t15" no="14">
								<p class="keywords"><a class="div_typename div_font"></a></p>
							</div>

						</div>
						<div class="mp-category-item">
							<div class="shop_skin_index_list" rel="edit-t08" no="7">
								<div class="img"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t16" no="15">
							   <p class="keywords"><a class="div_typename div_font"></a></p>
							</div>

						</div>
						<div class="mp-category-item">
							<div class="shop_skin_index_list" rel="edit-t09" no="8">
								<div class="img"></div>
							</div>
							<div class="name shop_skin_index_list" rel="edit-t17" no="16">
								<p class="keywords"><a class="div_typename div_font"></a></p>
							</div>

						</div>


					</div>
				</div>
			</div>

			<?php

				$query_pronum = "select count(1) as pro_num from weixin_commonshop_products where ishot=true and isvalid=true and isout=0 and customer_id=".$customer_id;
					if(!empty($owner_typeids)){
					 //查找自己微店的产品
						 $query_pronum = $query_pronum." and (";
						 $owner_typeids_arr = explode(",",$owner_typeids);
						 $owner_typeids_count = count($owner_typeids_arr);
						 for($j=0;$j<$owner_typeids_count;$j++){
							 $o_typeid = $owner_typeids_arr[$j];
							 if($j==0){
								$query_pronum = $query_pronum."(type_id=".$o_typeid." or LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }else{
								$query_pronum = $query_pronum." or (type_id=".$o_typeid." or LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }
						 }
						 $query_pronum = $query_pronum.")";
					}
					if($city_id){
						$query_pronum= $query_pronum." and pro_area='".$city_id."'";

					}

					$result_pronum = _mysql_query($query_pronum) or die('Query query_pronum: ' . mysql_error());
					while ($row = mysql_fetch_object($result_pronum)) {
						$pro_num=$row->pro_num;

					}
				if($pro_num){//所在地区有热卖产品才显示
			?>

			<div class="mp-hot">
				<h2 class="mp-modtitle">
					<div class="name shop_skin_index_list" rel="edit-t18" no="17">
						<a class="div_typename div_font"></a>
					</div>
				</h2>
				<div class="mp-hot-con">
					<ul>

					<?php


					$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count,introduce from weixin_commonshop_products where ishot=true and isvalid=true and isout=0 and customer_id=".$customer_id."";
					if(!empty($owner_typeids)){
					 //查找自己微店的产品
						 $query = $query." and (";
						 $owner_typeids_arr = explode(",",$owner_typeids);
						 $owner_typeids_count = count($owner_typeids_arr);
						 for($j=0;$j<$owner_typeids_count;$j++){
							 $o_typeid = $owner_typeids_arr[$j];
							 if($j==0){
								$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }else{
								$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }
						 }
						 $query = $query.")";
					}
					if($city_id){
						$query= $query." and pro_area='".$city_id."'";

					}
					$query= $query." order by asort_value desc,id desc limit 0,6";

					//echo $query;
					$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
						while ($row = mysql_fetch_object($result)) {
							$pid = $row->id;
							$pname = $row->name;
							$orgin_price = $row->orgin_price;
							$now_price = $row->now_price;
							$p_img = $row->default_imgurl;
							$type_ids =$row->type_ids;
							$pro_discount=$row->pro_discount;
							$sell_count =$row->sell_count;
							$show_sell_count =$row->show_sell_count;
							$introduce= $row->introduce;

							if(empty($p_img)){
								$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
								$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
								$p_img = "";
								while ($row2 = mysql_fetch_object($result2)) {
								$p_img= $row2->imgurl;
								}
							 }

			?>
						<li class="mp-flexbox mp-hot-prod mp-border-bottom">
							<div class="mp-hotlist-img">
								<img src="<?php echo $new_baseurl.$p_img;?>">
							</div>
							<div class="mp-flexbox-item mp-hotlist-infos">
								<div class="mp-hotlist-title"><?php echo $pname;?></div>
								<div class="mp-hotlist-desc"><?php echo $introduce;?></div>
							</div>
							<div class="mp-hotlist-price">
							<?php if(OOF_P != 2) echo OOF_S ?>
							<em><?php echo $now_price;?></em>
							<?php if(OOF_P == 2) echo OOF_S ?>
							<span class="mp-price-text">起</span></div>
							<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id; ?>" class="mp-fulllink"></a>
						</li>
						<?php }?>
					</ul>
					<a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>"><div class="mp-modmore">查看所有产品</div></a>
				</div>
			</div>
			<?php } //所在地区热卖产品结束?>


			<?php
				$query2="select index_imgurl  from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
					$query2 = $query2." and id in (".$owner_typeids.")";
				}
				$query2=$query2;
				$is_index_imgurl = 0;
				$result2 = _mysql_query($query2) or die('Query failed2: ' . mysql_error());
				while ($row = mysql_fetch_object($result2)) {
					$index_imgurl=$row->index_imgurl;

					if(!empty($index_imgurl)){
						$is_index_imgurl = 1;
					}
				}
				if($is_index_imgurl){
			?>
			<div class="mp-hot">
				<h2 class="mp-modtitle">
					<div class="name shop_skin_index_list" rel="edit-t19" no="18">
						<a class="div_typename div_font"></a>
					</div>
				</h2>
				<div>
				<?php //分类楼层广告开始
				$query1="select id,index_imgurl,index_catnum,name from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
					$query1 = $query1." and id in (".$owner_typeids.")";
				}

				if($sort_str){
				 $query1 =$query1.' order by field(id'.$sort_str.')';
				 }

				$result1 = _mysql_query($query1) or die('Query failed1: ' . mysql_error());
				while ($row = mysql_fetch_object($result1)) {
					$tid = $row->id;
					$index_imgurl = $row->index_imgurl;
					$index_catnum = $row->index_catnum;
					$tname = $row->name;

					//$query_q = "select id from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id." and type_id=".$tid;
					//$result_q = _mysql_query($query_q) or die('Query failed: ' . mysql_error());
					//$rcount_q2 = mysql_num_rows($result_q);
					if(!empty($index_imgurl)){
				?>
					<div class="mp-product-item">
						<a href="../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id_en; ?>"><img src="<?php echo $new_baseurl.$index_imgurl;?>"></a>
					</div>
				<?php }} //分类楼层广告结束?>

				</div>
			</div> <!--分类楼层广告-->
			<?php }?>
		</div>

	</div>
	 <?php


			if($supportname){
		?>
        <style>
			.foot_img img{width:60px;}
		</style>
			<div class="" style="width:100%;display:block;padding:18px 0px;">
            	<section class="members_goodspic" style="margin:10px;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>

</div>

<?php }else if($template_id==47){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	<div class="main">
		<div class="search-box">
			<div class="shop_skin_index_list"  rel="edit-t01" no="0">
				<div class="img"></div>

			</div>
			<div class="search-layer">
				<input type="text" class="search-input" id="searchname" name="searchname"  onkeydown="if(event.keyCode==13){search_name();}" placeholder="正品保障，私密发货" style="border-radius:3px;">
				<button class="search-button" onclick="search_name();"></button>
			</div>
		</div>

		<div class="shop_skin_index_list banner"  rel="edit-t02" no="1">
			<div class="img"></div>
			<div class="mod" style="display: none;">&nbsp;</div>
		</div>

		<div class="content-box">
			<div class="icon-box">
				<div class="shop_skin_index_list" rel="edit-t03" no="2">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t11" no="10">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="icon-box">
				<div class="shop_skin_index_list" rel="edit-t04" no="3">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t12" no="11">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="icon-box">
				<div class="shop_skin_index_list" rel="edit-t05" no="4">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t13" no="12">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="icon-box">
				<div class="shop_skin_index_list" rel="edit-t06" no="5">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t14" no="13">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="icon-box">
				<div class="shop_skin_index_list" rel="edit-t07" no="6">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t15" no="14">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="icon-box">
				<div class="shop_skin_index_list" rel="edit-t08" no="7">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t16" no="15">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="icon-box">
				<div class="shop_skin_index_list" rel="edit-t09" no="8">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t17" no="16">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="icon-box">
				<div class="shop_skin_index_list" rel="edit-t10" no="9">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t18" no="17">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="clear"></div>

		<script>
	$(document).ready(function(){

	var window_width=$(window).width();
	var banner_width =window_width;
	var left_width=$(window).width()/2.4;
	var top_width=$(window).width()/1.7;
	var top_height=$(window).width()/1.7/3;
	//var top_height=top_width/3;
	var bottom_width=$(window).width()/1.7;
	var banner_pren_h=$(window).width()/3.17;
	var product_css=$(window).width()/2;
	var product_css1=$(window).width()/3;
	var bottom_img_h=$(window).width()/6.24;
	var search_height=$(window).width()/9;

	$(".banner img").css("width",banner_width+"px");
	$(".search-box").css("height",search_height+"px");
	$(".search-layer").css("top",search_height/2-13+"px");
	$(".left-img img").css("width",top_width+"px");
	$(".right-top-img img").css("width",top_width+"px");
	$(".right-top-img img").css("height",top_height+"px");

	$(".right-top-img .img").css("height",top_height+"px");

	$(".right-bottom-img img").css("height",top_height+"px");
	$(".right-bottom-img img").css("width",bottom_width+"px");
	$(".banner_pren").css("width",window_width+"px");
	$(".banner_pren").css("height",banner_pren_h+"px");
	$(".product_css").css("width",product_css+"px");
	$(".product_css").css("height",product_css+"px");
	$(".product_css1").css("width",product_css1+"px");
	$(".product_css1").css("height",product_css1+"px");
	$(".bottom_img img").css("width",window_width+"px");
	$(".bottom_img img").css("height",bottom_img_h+"px");
	$(".w50-img").css("width",product_css+"px");
	$(".w50-img").css("height",product_css+"px");

	});
	$(function(){
            $(window).resize(function(){
            var two_height=$('.right-top-img img').innerHeight()+$('.right-bottom-img img').innerHeight();
            $('.left-img img').height(two_height);
        });
             $(window).resize();
        })

	</script>



		</div>
		<div class="img-box">
			<div class="shop_skin_index_list left-img" rel="edit-t19" no="18">
				<div class="img " ></div>
			</div>
			<div class="shop_skin_index_list right-top-img" rel="edit-t20" no="19">
				<div class="img "></div>
			</div>

			<div class="shop_skin_index_list right-bottom-img" rel="edit-t21" no="20">

				<div class="img "></div>
			</div>


			<div class="clear"></div>
		</div>

		<?php

			$cat="select id,name,cat_index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and parent_id <0 ";

			if($sort_str){
			 $cat =$cat.' order by field(id'.$sort_str.')';
			 }
			$result_cat=_mysql_query($cat) or die ("cat_query faild" .mysql_error());
			while($row=mysql_fetch_object($result_cat)){
				$cat_parid=$row->id;
				$cat_parname=$row->name;
				$cat_parimgurl=$row->cat_index_imgurl;
				$cat_adurl=$row->cat_adurl;

				//$cat_parname2 = substr($cat_parname,0,4);
				$cat_parname2 = mb_substr($cat_parname,0,4,'utf-8');
				if($cat_parimgurl){
		?>


		<div class="product-box">
			<div class="title">

				<span style="position:absolute;left:3px;line-height:31px;color:#fff;"><?php echo $cat_parname2;?></span>
				<img src="../common/fengge47/images/title.png" class="title">
			</div>
			<a href="../../mshop/list.php?tid=<?php echo $cat_parid; ?>&tname=<?php echo $cat_parname; ?>&customer_id=<?php echo $customer_id_en; ?>"><span class="more">更多>></span></a>
			<a href="<?php echo $cat_adurl?>"><img src="<?php echo $new_baseurl.$cat_parimgurl;?>" class="banner banner_pren"></a><!--一级分类首页图-->
			<?php  //子分类
				$i=1;
				$cat_son="select id,name,cat_index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and top_id=".$cat_parid." order by id desc limit 0,5";
				$result_cat_son=_mysql_query($cat_son) or die ('cat_son_query faild' .mysql_error());
				while($row=mysql_fetch_object($result_cat_son)){
					$cat_sonid=$row->id;
					$cat_sonname=$row->name;
					$cat_sonimgurl=$row->cat_index_imgurl;
					$cat_sonadurl=$row->cat_adurl;
				if($cat_sonimgurl){
			?>
			<a href="<?php echo $cat_sonadurl?>"><img src="<?php echo $new_baseurl.$cat_sonimgurl;?>" class="<?php if($i==1){echo 'left-product product_css';}elseif($i==2){echo 'right-product product_css';}elseif($i==3){echo 'three-product border-right product_css1';}elseif($i==4){echo 'three-product border-right product_css1';}elseif($i==5){echo 'three-product product_css1';}?>"></a>

				<?php }?>
				<?php $i++;}?> <!--子分类结束-->
		</div>

			<?php }}?> <!--分类结束-->

		<div style="">
			<?php
				$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count,introduce from weixin_commonshop_products where ishot=true and isvalid=true and isout=0 and customer_id=".$customer_id."";
					if(!empty($owner_typeids)){
					 //查找自己微店的产品
						 $query = $query." and (";
						 $owner_typeids_arr = explode(",",$owner_typeids);
						 $owner_typeids_count = count($owner_typeids_arr);
						 for($j=0;$j<$owner_typeids_count;$j++){
							 $o_typeid = $owner_typeids_arr[$j];
							 if($j==0){
								$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }else{
								$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
							 }
						 }
						 $query = $query.")";
					}

					$query= $query." order by asort_value desc,id desc";

					//echo $query;
					$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
						while ($row = mysql_fetch_object($result)) {
							$pid = $row->id;
							$pname = $row->name;
							$orgin_price = $row->orgin_price;
							$now_price = $row->now_price;
							$p_img = $row->default_imgurl;
							$type_ids =$row->type_ids;
							$pro_discount=$row->pro_discount;
							$sell_count =$row->sell_count;
							$show_sell_count =$row->show_sell_count;
							$introduce= $row->introduce;

							if(empty($p_img)){
								$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
								$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
								$p_img = "";
								while ($row2 = mysql_fetch_object($result2)) {
								$p_img= $row2->imgurl;
								}
							 }

			?>
			<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id; ?>"><img src="<?php echo $new_baseurl.$p_img;?>" class="w50-img"></a>
			<?php }?>
		</div><!--产品列表结束-->

		<div class="shop_skin_index_list" rel="edit-t30" no="29">
			<div class="img bottom_img" ></div>
		</div>

		 <?php


			if($supportname){
		?>
        <style>
			.foot_img img{width:60px;}
		</style>
			<div class="" style="width:100%;display:block;">
            	<section class="members_goodspic" style="margin:10px;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;padding-top:65px;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>
		<?php if($is_showbottom_menu){
		/*<div class="footer">
			<div class="footer-box">
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t22" no="21">
						<div class="img"></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t26" no="25">
					   <p><div class="div_typename" ></div></p>
					</div>
				</div>
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t23" no="22">
						<div class="img"></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t27" no="26">
					   <p><div class="div_typename" ></div></p>
					</div>
				</div>
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t24" no="23">
						<div class="img"></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t28" no="27">
					   <p><div class="div_typename" ></div></p>
					</div>
				</div>
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t25" no="24">
						<div class="img"></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t29" no="28">
					   <p><div class="div_typename" ></div></p>
					</div>
				</div>
			</div>
		</div>*/
		 }?>
		<div class="clear-fix"></div>
	</div>

</div><!--shop_skin_index end-->

<?php }else if($template_id==48){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>;overflow-x:hidden;"<?php } ?> >
	<div class="am-g am-g-collapse" style="height:45px;width:100%;">
		<section class="mix_new_header">
			<div class="search">
				<div class="text_box">
					<input id="searchname" name="searchname"  onkeydown="if(event.keyCode==13){search_name();}" type="text"  placeholder="搜索商品、品牌、种类" class="keyword text"  maxlength="70" >
				</div>
				<span class="mix_submit"></span>
				<a href="javascript:search_name();" class="clear_input" id="clear_input" style="display: block;">搜索</a>
			</div>
		</section>
	</div>
	<style>
		.banner img {max-width:720px;}
		.small_ad ul{display:block;overflow:hidden;height:100%;}
		.small_ad img{max-width:249px;max-height:316px;}
		.hot-floor img{max-width:720px;max-height:400px;}
		.mix_new_header .search .clear_input {right:-37px;top:3px;}
		#category{display:none}
	</style>
	<script>
	$(document).ready(function(){

	var window_width=$(window).width();

	$(".banner img").css("width",window_width+"px");
	$(".banner").css("height",window_width/2+"px");
	$(".banner img").css("height",window_width/2+"px");
	$(".small_ad img").css("width",window_width/3+"px");
	$(".small_ad img").css("height",window_width/3*1.27+"px");
	$(".hot-floor img").css("width",window_width+"px");
	$(".hot-floor img").css("height",window_width/1.8+"px");

	$(".banner_pren").css("width",window_width+"px");
	$(".banner_pren").css("height",window_width/2.35+"px");
	$(".cat_sonimg").css("width",window_width/3+"px");
	});
	</script>

	<div class="shop_skin_index_list banner"  rel="edit-t01" no="0">
		<div class="img"></div>
	</div>
	<div class="am-g ct bf ade mt8">
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t02" no="1">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t10" no="9">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t03" no="2">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t11" no="10">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t04" no="3">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t12" no="11">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t05" no="4">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t13" no="12">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t06" no="5">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t14" no="13">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t07" no="6">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t15" no="14">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t08" no="7">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t16" no="15">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t09" no="8">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t17" no="16">
				<a class="div_typename"></a>
			</div>
		</div>
	</div>
	<div class="shu3 mt8 small_ad">
		<ul>
			<li>
				<div class="shop_skin_index_list" rel="edit-t18" no="17">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t19" no="18">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t20" no="19">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t21" no="20">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t22" no="21">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t23" no="22">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t24" no="23">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t25" no="24">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t26" no="25">
					<div class="img"></div>
				</div>
			</li>


		</ul>
	</div>
	<div class="clear"></div>

	<?php
		$i=0;
		$tem_floor="select id,position from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=48 and isvalid=true and position >=27 and position <=31 order by position asc";
		$result_tem_floor=_mysql_query($tem_floor) or die ('tem_floor faild ' .mysql_error());
		while($row=mysql_fetch_object($result_tem_floor)){
			$position=$row->position;


	?>
		<div class="floor hot-floor" <?php if($i==0){?>style="margin-top:10px;"<?php }?>>
			<div class="shop_skin_index_list newad" rel="edit-t<?php echo $position?>" no="<?php echo $position-1?>">
				<div class="img"></div>
			</div>
		</div>
	<?php
		$i++;
		}
	?>


	<!--
	<div class="floor hot-floor" style="margin-top:10px;">
		<div class="shop_skin_index_list" rel="edit-t27" no="26">
			<div class="img"></div>
		</div>
	</div>
	<div class="floor hot-floor">
		<div class="shop_skin_index_list" rel="edit-t28" no="27">
			<div class="img"></div>
		</div>
	</div>
	<div class="floor hot-floor">
		<div class="shop_skin_index_list" rel="edit-t29" no="28">
			<div class="img"></div>
		</div>
	</div>
	<div class="floor hot-floor">
		<div class="shop_skin_index_list" rel="edit-t30" no="29">
			<div class="img"></div>
		</div>
	</div>
	<div class="floor hot-floor">
		<div class="shop_skin_index_list" rel="edit-t31" no="30">
			<div class="img"></div>
		</div>
	</div>
	-->

	<!--分类楼层图片-->
	<div style="/*margin-bottom:50px;display:block;overflow:hidden;margin-bottom:20px;*/">
	<?php

		$cat="select id,name,cat_index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and parent_id <0";

		if($sort_str){
		 $cat =$cat.' order by field(id'.$sort_str.')';
		 }
		$result_cat=_mysql_query($cat) or die ("cat_query faild" .mysql_error());
		while($row=mysql_fetch_object($result_cat)){
			$cat_parid=$row->id;
			$cat_parname=$row->name;
			$cat_parimgurl=$row->cat_index_imgurl;
			$cat_adurl=$row->cat_adurl;

			//$cat_parname2 = substr($cat_parname,0,4);
			$cat_parname2 = mb_substr($cat_parname,0,4,'utf-8');
			if($cat_parimgurl){
	?>
	<div class="yuangg">
		<a href="<?php echo $cat_adurl?>"><img src="<?php echo $new_baseurl.$cat_parimgurl;?>" class="banner banner_pren"></a><!--一级分类首页图-->
		<?php  //子分类
			$i=1;
			$cat_son="select id,name,cat_index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and top_id=".$cat_parid." order by id asc limit 0,3";
			$result_cat_son=_mysql_query($cat_son) or die ('cat_son_query faild' .mysql_error());
			while($row=mysql_fetch_object($result_cat_son)){
				$cat_sonid=$row->id;
				$cat_sonname=$row->name;
				$cat_sonimgurl=$row->cat_index_imgurl;
				$cat_sonadurl=$row->cat_adurl;
			if($cat_sonimgurl){
		?>
				<a href="<?php echo $cat_sonadurl?>"><img src="<?php echo $new_baseurl.$cat_sonimgurl;?>" class="cat_sonimg"></a>
			<?php }?>
		<?php $i++;}?> <!--子分类结束-->
		<div class="clear"></div>
	</div>
	<?php }}?> <!--分类结束-->
	</div>


	    		  <style>
  	.foot_img img {width:60px;}
  </style>
   <?php

			$supporttype=-1; //1代表商城名字 2 代表公众号名字
			$supportname="";
			$support_fontcolor="";
			$support_linkurl="";
			$supportImg="";

	   		$support_query="select supporttype,supportname,support_fontcolor,support_linkurl,supportImg from customers where id=".$customer_id."";
			$result_support=_mysql_query($support_query) or die ('support_query faild' .mysql_error());
			while($row=mysql_fetch_object($result_support)){
				$supporttype=$row->supporttype;
				$supportname1=$row->supportname;
				$support_fontcolor=$row->support_fontcolor;
				$support_linkurl=$row->support_linkurl;
				$supportImg=$row->supportImg;
				}
			switch ($supporttype){
				case 1:
					$support_name="select name from weixin_commonshops where customer_id=".$customer_id."";
					$result_supportname=_mysql_query($support_name) or die ('support_name faild' .mysql_error());
					while($row=mysql_fetch_object($result_supportname)){
						$supportname=$row->name;
						}
					break;
				case 2:
					$support_name="select weixin_name from weixin_baseinfos where customer_id=".$customer_id."";
					$result_supportname=_mysql_query($support_name) or die ('support_name faild' .mysql_error());
					while($row=mysql_fetch_object($result_supportname)){
						$supportname=$row->weixin_name;
						}

					break;
				case 3:
					$supportname=$supportname1;
					break;
				}
			if($supportname){
		?>

			<div class="" style="width:100%;display:block;padding:18px 0px;padding-bottom:18px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>

                    <div style="text-align:center;width:100%;padding-top: 60px;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>


	<!--<div style="height:10px;width:100%;"></div>-->
	<?php if($is_showbottom_menu){
	/*<div style="width:100%;display:block;height:50px;"></div>
	<div class="sstfo"><!--底部菜单-->
		<ul>
			<li>
				<div class="shop_skin_index_list" rel="edit-t32" no="31">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t36" no="35">
					<a class="div_typename"></a>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t33" no="32">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t37" no="36">
					<a class="div_typename"></a>
				</div>
			</li>
		   <li>
				<div class="shop_skin_index_list" rel="edit-t34" no="33">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t38" no="37">
					<a class="div_typename"></a>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t35" no="34">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t39" no="38">
					<a class="div_typename"></a>
				</div>
			</li>

		</ul>
	</div>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 }?>

</div>
<?php }else if($template_id==49){?>
<style>
#bottom_footer{position:fixed;z-index:1000;bottom:0;background:#f9f9f9;width:100%;height:50px;border-top:2px solid #c9c9c9;box-sizing:border-box;}
#bottom_footer div .foot{float:left;text-align:center;height:50px;line-height:50px;}
.arrow_weixin{background: url("./images/textmenuicon.png") no-repeat scroll 0 0;width:15px;height: 15px;background-size: 15px 15px;font-size: 14px;line-height: 45px;display: inline-block;vertical-align: middle;}
.submenu{position:absolute;padding:5px 8px;background:#eaeaea;text-align:center;border-radius:5px;font-size:14px;line-height:41px;z-index:11;background-color:#fafafa;bottom:56px;border:1px solid #ccc;}
.arrow{position: absolute;z-index: 11;border-right: 6px solid transparent;border-left: 6px solid transparent;border-bottom:0px none;}
.line-divide{border-top: 2px solid #e5e5e5;}
#bottom_footer .wid a:hover{text-decoration:none;color:#333;}
</style>
<div id="shop_skin_index">
		<div class="shop_skin_index_list" id="firpic" rel="edit-t01" no="0" style="width:100%;">
			<div class="img"></div>
			<div class="mod" style="display: none;">&nbsp;</div>

		</div>
		<div class="title shop_skin_index_list" rel="edit-t02" no="1" >
			<div class="div_typename"></div>
		</div>

		<ul class=" custom-coupon" style="float:left;">
            <li>
				<div class="shop_skin_index_list custom-coupon-price" rel="edit-t03" no="2" style="float:none;">
					<a class="div_typename" style="font-weight: bold;"></a>
				</div>
				<div class="shop_skin_index_list custom-coupon-desc" rel="edit-t04" no="3" style="float:none;">
					<a class="div_typename" ></a>
				</div>
            </li>
            <li>
				<div class="shop_skin_index_list custom-coupon-price" rel="edit-t05" no="4" style="float:none;">
					<a class="div_typename" style="font-weight: bold;"></a>
				</div>
				<div class="shop_skin_index_list custom-coupon-desc" rel="edit-t06" no="5" style="float:none;">
					<a class="div_typename" ></a>
				</div>
            </li>
            <li>
				<div class="shop_skin_index_list custom-coupon-price" rel="edit-t07" no="6" style="float:none;">
					<a class="div_typename" style="font-weight: bold;"></a>
				</div>
				<div class="shop_skin_index_list custom-coupon-desc" rel="edit-t08" no="7" style="float:none;">
					<a class="div_typename" ></a>
				</div>
            </li>
        </ul>
		<div class="notice shop_skin_index_list " rel="edit-t09" no="8" >
			<div class="div_typename js-scroll-notice notice"></div>
		</div>
		<div>
			<div class="shop_skin_index_list i0" rel="edit-t10" no="9">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i0" rel="edit-t11" no="10">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i0" rel="edit-t12" no="11">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i0" rel="edit-t13" no="12">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
		</div>
		<div class="shop_skin_index_list" rel="edit-t14" no="13">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
		</div>
		<div class="shop_skin_index_list banner" id="banpic" rel="edit-t15" no="14" >
			<div class="img"><div class="slider">
			<div class="flexslider">
			<div class="flex-viewport" style="overflow: hidden; position: relative;">
			<ul class="slides" style="width: 1000%; -webkit-transition: 0s; transition: 0s; -webkit-transform: translate3d(-2526px, 0, 0);"><li class="clone" style="width: 1263px; float: left; display: block;"><a href="#/api/c209e836af/shop/products/2066/">
			</a></li></ul></div></div></div></div>
		</div>
		<div class="shop_skin_index_list" style="width: 100%;">
			<hr style="border-top: 1px;border-top: 1px dashed #bbb;">
		</div>
		<div class="shop_skin_index_list" rel="edit-t16" no="15">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
		</div>
		<div class="shop_skin_index_list" rel="edit-t17" no="16">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
		</div>
		<div>
			<div class="shop_skin_index_list i2" rel="edit-t18" no="17">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
			<div class="shop_skin_index_list i2" rel="edit-t19" no="18">
				<div class="img"></div><div class="mod" style="display: none;">&nbsp;</div>
			</div>
		</div>
		<div class="shop_skin_index_list" style="width: 100%;">
			<hr style="border-top: 1px;border-top: 1px dashed #bbb;">
		</div>
		<div class="box">
			<ul>
			<?php
			$index_imgurl="";
			$query="select id,index_imgurl,name from weixin_commonshop_types where isvalid=true and is_shelves=1 and parent_id=-1 and customer_id=".$customer_id;
		   if(!empty($owner_typeids)){
		      $query = $query." and id in (".$owner_typeids.")";
		   }
		   $query=$query." order by id desc";
		   $result = _mysql_query($query) or die('Query failed: ' . mysql_error());
		   while ($row = mysql_fetch_object($result)) {
			  $tid = $row->id;
			  $tname = $row->name;
			  $index_imgurl = $row->index_imgurl;

			$type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
			$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
			while($row=mysql_fetch_object($result_typeson)){

				$typeson_id[]=$row->id;
				//$typeson_id1[]=$row->id;
			}

			   if(!empty($index_imgurl)){
			?>
				<li>
					<!--<div class="shop_skin_index_list content" rel="edit-t18" no="17">
						<div class="img"></div><span onclick="document.location='../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id; ?>';"><?php echo $tname; ?></span>
					</div>-->
					<div class="shop_skin_index_list members_co1" >
						<div class="img">
							<a onclick="document.location='../../mshop/list.php?tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>&customer_id=<?php echo $customer_id; ?>';">
							<?php if($index_imgurl==""){?>
								<img src="../common/fengge45/img/feilei.jpg">
							<?php }else{ ?>
								<img src="<?php echo $new_baseurl.$index_imgurl;?>">
							<?php } ?>
							</a>
						</div>
					</div>
					<script>
						$(document).ready(function(){
							var window_width=$(window).width();
							$(".pro_img img").css("width",window_width/2.17+"px");
							$(".pro_img img").css("height",window_width/2.17+"px")
						})
					</script>
					<div  class="products">

					<?php
							array_push($typeson_id,$tid);
							$typeson_id=implode(',',$typeson_id);
							$query1 = "select id,orgin_price,now_price,default_imgurl,type_ids from weixin_commonshop_products where  isvalid=true and isout=0 and customer_id=".$customer_id;
							if(empty($typeson_id)){
								$typeson_id=$tid;
							}
								$query1 = $query1." and (";
								$typeson_id_arr = explode(",",$typeson_id);
								$typeson_id_count = count($typeson_id_arr);
								for($j=0;$j<$typeson_id_count;$j++){
									$o_typeid = $typeson_id_arr[$j];
									if($j==0){
										$query1 = $query1."(LOCATE(',".$o_typeid.",', type_ids)>0)";
										}else{
										$query1 = $query1." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
									}
								}
								$query1 = $query1.")";
							if(!empty($owner_typeids)){
							 //查找自己微店的产品
								 $query1 = $query." and (";
								 $owner_typeids_arr = explode(",",$owner_typeids);
								 $owner_typeids_count = count($owner_typeids_arr);
								 for($j=0;$j<$owner_typeids_count;$j++){
									 $o_typeid = $owner_typeids_arr[$j];
									 if($j==0){
										$query1 = $query1."(LOCATE(',".$o_typeid.",', type_ids)>0)";
									 }else{
										$query1 = $query1." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
									 }
								 }
								 $query1 = $query1.")";
							}
							$query1 = $query1." order by asort_value desc,id desc";
							$result1 = _mysql_query($query1) or die('Query failed2: ' . mysql_error());
							while ($row = mysql_fetch_object($result1)) {
								$pid = $row->id;
								$orgin_price = $row->orgin_price;
								$now_price = $row->now_price;
								$p_img = $row->default_imgurl;
								$type_ids =$row->type_ids;
							if(empty($p_img)){
							    $query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
							    $result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
							    $p_img = "";
							    while ($row2 = mysql_fetch_object($result2)) {
								$p_img= $row2->imgurl;
								}
							 }

					?>
									<div  class="items" style="float:left;width:46%;margin:1% 2% 1% 2%">
										<div  class="pro_img" id="propic" style="width:100%;"><a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id; ?>"><div class="img " ><img class="auto_img" src="<?php echo $new_baseurl.$p_img;?>"></div><div style="float:left;" ><span class="now_prices" style="color:#ff495b;">
										<?php if(OOF_P != 2) echo OOF_S ?>
										<?php echo $now_price;?>
										<?php if(OOF_P == 2) echo OOF_S ?>
										</span></br> <span class="orgin_prices">原价：
										<?php if(OOF_P != 2) echo OOF_S ?>
										<?php echo $orgin_price;?>
										<?php if(OOF_P == 2) echo OOF_S ?>
										</span>
										</div><div class="goods-buy">我要抢购</div>
										</a></div>
									</div>
					<?php

						}
					?>
				</div>
				</li>

			<?php }unset($typeson_id); } ?>
			</ul>
		</div>
			<div id="footer_points"></div>
			<?php if($is_showbottom_menu){
				/*<footer id="bottom_footer">
				<div>
					<div class="home foot" style="width:16%;border-right:1px solid #ccc;">
						<a href="index.php" style="background:#F9F9F9;"><img src="images/ico_home.png" style="width: 30px;height:30px;margin-top:10px;"></a>
					</div>
					<?php
						$result=_mysql_query("select count(1) as ccount from weixin_commonshop_userdefined_nav where isvalid=true and customer_id=".$customer_id) or die('Query failed_nav1:'.mysql_error());
						while($row=mysql_fetch_object($result)){
							$ccount=$row->ccount;
						}
						$j=1;
						$chk_submenu=0;
						$result=_mysql_query("select name,chk_submenu,navigation_link,subpros,sublinks from weixin_commonshop_userdefined_nav where isvalid=true and customer_id=".$customer_id) or die('Query failed_nav1:'.mysql_error());
						while($row=mysql_fetch_object($result)){
							$name=$row->name;
							$chk_submenu=$row->chk_submenu;
							$navigation_link=$row->navigation_link;
							$subpros=$row->subpros;
							$sublinks=$row->sublinks;

						$pro_separate=explode("#",$subpros);
						$links_separate=explode("#",$sublinks);
						$count=count($pro_separate);
						if($j!=$ccount){
					?>
					<div class="foot wid" style="border-right:1px solid #ccc;">
						<a href="<?php echo $navigation_link?$navigation_link:"##";?>"><i class="arrow_weixin"></i><span><?php echo $name;?></span>
						</a>
						<?php if($chk_submenu==1){ ?>
						<!--子菜单-->
						<div class="submenu" style="display:none;">
							<span class="arrow" style="right:auto;border-top:6px solid #ccc;bottom: -6px;"></span>
							<span class="arrow" style="right:auto;border-top:6px solid #fafafa;bottom: -5px;"></span>
							<ul>
							<?php for($i=1;$i<=$count;$i++){
							?>
								<li>
                                    <a href="<?php echo $links_separate[$i-1];?>"><?php echo $pro_separate[$i-1];?></a>
                                </li>
								<?php if($i!=$count){ ?><li class="line-divide"></li><?php } ?>
							<?php  } ?>
							</ul>
						</div>
						<?php } ?>
					</div>
						<?php }else{ ?>
							<div class="foot wid" >
								<a href="<?php echo $navigation_link?$navigation_link:"##";?>"><i class="arrow_weixin"></i><span><?php echo $name;?></span>
								</a>
								<?php if($chk_submenu==1){ ?>
								<!--子菜单-->
								<div class="submenu" style="display:none;">
									<span class="arrow" style="right:auto;border-top:6px solid #ccc;bottom: -6px;"></span>
									<span class="arrow" style="right:auto;border-top:6px solid #fafafa;bottom: -5px;"></span>
									<ul>
									<?php for($i=1;$i<=$count;$i++){?>
										<li>
											<a href="<?php echo $links_separate[$i-1];?>"><?php echo $pro_separate[$i-1];?></a>
										</li>
										<?php if($i!=$count){ ?><li class="line-divide"></li><?php } ?>
									<?php  } ?>
									</ul>
								</div>
								<?php } ?>
							</div>
						<?php } $j++;} ?>
				</div>
			   </footer>*/
			   /*判断是否显示底部菜单 start*/
				require_once('../../common/utility_setting_function.php');
				$fun = "index";
				$is_publish = check_is_publish(2,$fun,$customer_id);

				if($is_publish){
					require_once('../../mshop/bottom_label.php');
				}
				/*判断是否显示底部菜单 end*/
		    } ?>

		<style>
			.foot_img img {width:60px;}
		</style>
		<?php


			if($supportname){
		?>

			<div class="" style="width:100%;display:block;height:72px;position:relative;bottom:28px;">
            	<section class="members_goodspic" style="margin-top:0px!important;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>


	</div>


<script>
$(document).ready(function(){
	var submenu_count=<?php echo $ccount;?>;
	var foot_width=(81/submenu_count)+"%";
	$('.wid').width(foot_width);
})
$('.foot').click(function(){
	var foot_w=$(this).width();
	//var foot_c=(foot_w-16)/2
	$(this).children('div').width(foot_w-16);
	$(this).children('div').children(".arrow").css("left",((foot_w-16)/2)+"px");
	$(this).children('div').toggle();
	$(this).siblings().children('div').hide();
})
		var e = $(".js-scroll-notice");
		e.length && e.each(function() {
		function e() {
			i--, 0 > i + t && (i = o), n.css({
				left: i
			})
		}
		var n = $(this),
			t = n.width(),
			o = t,
			i = 0;
		 n.css({
			position: "relative"
		}), setInterval(e, 25)
	})

var window_width=$(window).width();
var fir_width=window_width/2.5;
//$("#firpic").css("height",fir_width);
var ban_width=window_width/2;
$("#banpic").css("height",ban_width);
var propic_width=$("#propic").width();
var propic=propic_width/1.5;
$("#propic").css("height",propic);
</script>
<?php }else if($template_id==50){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>;overflow-x:hidden;"<?php } ?> >
	<div class="am-g am-g-collapse" style="height:45px;width:100%;">
		<section class="mix_new_header">

			<div class="search">
				<div class="text_box">
					<input id="searchname" name="searchname"  onkeydown="if(event.keyCode==13){search_name();}" type="text"  placeholder="搜索商品、品牌、种类" class="keyword text"  maxlength="70" >
				</div>
				<span class="mix_submit"></span>
				<a href="javascript:search_name();" class="clear_input" id="clear_input" style="display: block;">搜索</a>
			</div>
		</section>
	</div>
	<style>
		.banner img {max-width:1080px;}
		.small_ad ul{display:block;overflow:hidden;height:100%;}
		/*.small_ad img{max-width:249px;max-height:316px;}*/
		.hot-floor img{max-width:1080px;max-height:400px;}
		.marquee{height: 30px;line-height: 30px;font-size: 100%;border-top:1px solid #999;border-bottom:1px solid #999;margin-top:3px;white-space:nowrap;}
		.marquee *{font-size:14px;color:#CE8D15;}
		.clear_input{right:-37px !important;top:3px !important;}
		#category{display:none;}
	@media all and (min-width:1080px){
	  .marquee{height: 60px;line-height: 60px;font-size: 100%;border-top:1px solid #999;border-bottom:1px solid #999;margin-top:3px;white-space:nowrap;}
	  .marquee *{font-size:26px;color:#CE8D15;}
		}
	</style>
	<script>
	$(document).ready(function(){

	var window_width=$(window).width();

	$(".banner img").css("width",window_width+"px");
	$(".banner img").css("heihgt",window_width/2+"px");
	$(".small_ad img").css("width",window_width/3+"px");
	$(".small_ad img").css("height",window_width/3*1.27+"px");
	$(".hot-floor img").css("width",window_width+"px");
	$(".hot-floor img").css("height",window_width/1.8+"px");
	});
	</script>

	<div class="shop_skin_index_list banner"  rel="edit-t01" no="0">
		<div class="img"></div>
	</div>
	<div class="marquee shop_skin_index_list"  rel="edit-t02" no="1">
		<marquee scrollamount="2">
		<a nowrap class="div_typename r_color" style="color:#e60014"></a>
		</marquee>
	</div>
	<div class="am-g ct bf ade mt8">
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t03" no="2">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t11" no="10">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t04" no="3">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t12" no="11">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t05" no="4">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t13" no="12">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t06" no="5">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t14" no="13">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t07" no="6">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t15" no="14">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t08" no="7">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t16" no="15">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t09" no="8">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t17" no="16">
				<a class="div_typename"></a>
			</div>
		</div>
		<div class="am-u-sm-3">
			<div class="shop_skin_index_list" rel="edit-t10" no="9">
				<div class="img"></div>
			</div>

			<div class="shop_skin_index_list" rel="edit-t42" no="41">
				<a class="div_typename"></a>
			</div>
		</div>
	</div>
	<div class="shop_skin_index_list" rel="edit-t19" no="18"><!--添加视频-->
			<div class="div_typevideo"></div>
	</div>
	<div class="shu3 mt8 small_ad">
		<ul>
			<li>
				<div class="shop_skin_index_list" rel="edit-t20" no="19">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t21" no="20">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t22" no="21">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t23" no="22">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t24" no="23">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t25" no="24">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t26" no="25">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t27" no="26">
					<div class="img"></div>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t28" no="27">
					<div class="img"></div>
				</div>
			</li>

		</ul>
	</div>
	<div class="clear"></div>


	<?php
		$i=0;
		$tem_floor="select id,position from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=50 and isvalid=true and position >=29 and position <=33 order by position asc";
		$result_tem_floor=_mysql_query($tem_floor) or die ('tem_floor faild ' .mysql_error());
		while($row=mysql_fetch_object($result_tem_floor)){
			$position=$row->position;


	?>
		<div class="floor hot-floor" <?php if($i==0){?>style="margin-top:10px;"<?php }?>>
			<div class="shop_skin_index_list newad" rel="edit-t<?php echo $position?>" no="<?php echo $position-1?>">
				<div class="img"></div>
			</div>
		</div>
	<?php
		$i++;
		}
	?>

	<!--
	<div class="floor hot-floor" style="margin-top:10px;">
		<div class="shop_skin_index_list" rel="edit-t29" no="28">
			<div class="img"></div>
		</div>
	</div>
	<div class="floor hot-floor">
		<div class="shop_skin_index_list" rel="edit-t30" no="29">
			<div class="img"></div>
		</div>
	</div>
	<div class="floor hot-floor">
		<div class="shop_skin_index_list" rel="edit-t31" no="30">
			<div class="img"></div>
		</div>
	</div>
	<div class="floor hot-floor">
		<div class="shop_skin_index_list" rel="edit-t32" no="31">
			<div class="img"></div>
		</div>
	</div>
	<div class="floor hot-floor">
		<div class="shop_skin_index_list" rel="edit-t33" no="32">
			<div class="img"></div>
		</div>
	</div>
	-->
	<!--分类楼层图片-->
	<?php

		$cat="select id,name,cat_index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and parent_id <0 order by id desc";
		$result_cat=_mysql_query($cat) or die ("cat_query faild" .mysql_error());
		while($row=mysql_fetch_object($result_cat)){
			$cat_parid=$row->id;
			$cat_parname=$row->name;
			$cat_parimgurl=$row->cat_index_imgurl;
			$cat_adurl=$row->cat_adurl;

			//$cat_parname2 = substr($cat_parname,0,4);
			$cat_parname2 = mb_substr($cat_parname,0,4,'utf-8');
			if($cat_parimgurl){
	?>
	<div class="yuangg">
		<a href="<?php echo $cat_adurl?>"><img style="width:100%;" src="<?php echo $new_baseurl.$cat_parimgurl;?>" class="banner banner_pren"></a><!--一级分类首页图-->
		<?php  //子分类
			$i=1;
			$cat_son="select id,name,cat_index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and top_id=".$cat_parid." order by id desc limit 0,3";
			$result_cat_son=_mysql_query($cat_son) or die ('cat_son_query faild' .mysql_error());
			while($row=mysql_fetch_object($result_cat_son)){
				$cat_sonid=$row->id;
				$cat_sonname=$row->name;
				$cat_sonimgurl=$row->cat_index_imgurl;
				$cat_sonadurl=$row->cat_adurl;
			if($cat_sonimgurl){
		?>
				<a href="<?php echo $cat_sonadurl?>"><img style="width:100%;" src="<?php echo $new_baseurl.$cat_sonimgurl;?>" class="cat_sonimg"></a>
			<?php }?>
		<?php $i++;}?> <!--子分类结束-->
		<div class="clear"></div>
	</div>
	<?php }}?> <!--分类结束-->
	<?php if($is_showbottom_menu){
	/*<div style="width:100%;display:block;height:50px;"></div>
	<div class="sstfo"><!--底部菜单-->
		<ul>
		   <li>
				<div class="shop_skin_index_list" rel="edit-t34" no="33">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t38" no="37">
					<a class="div_typename"></a>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t35" no="34">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t39" no="38">
					<a class="div_typename"></a>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t36" no="35">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t40" no="39">
					<a class="div_typename"></a>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t37" no="36">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t41" no="40">
					<a class="div_typename"></a>
				</div>
			</li>
		</ul>
	</div>*/
	/*判断是否显示底部菜单 start*/
	require_once('../../common/utility_setting_function.php');
	$fun = "index";
	$is_publish = check_is_publish(2,$fun,$customer_id);

	if($is_publish){
		require_once('../../mshop/bottom_label.php');
	}
	/*判断是否显示底部菜单 end*/
	 }?>
</div>

<?php }else if($template_id==51){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>;"<?php } ?> >

	<?php
		$score_query="SELECT a.remain_score FROM weixin_card_member_scores a LEFT JOIN weixin_card_members b ON a.card_member_id =b.id  WHERE  b.user_id=".$user_id." limit 0,1";
		$score_result=_mysql_query($score_query) or die ("score query" .mysql_error());
		while($row=mysql_fetch_object($score_result)){
			$score=$row->remain_score;  //获取会员卡分数
		}

	?>

	<div class="main">
		<div class="search-box"><!--顶部开始-->
			<!--<div class="shop_skin_index_list  left-img" rel="edit-t01" no="0">
				<div class="img" ></div>
			</div>
			-->
			<div class="search-layer">
				<input type="text" id="searchname" name="searchname"  onkeydown="if(event.keyCode==13){search_name();}" class="search-input" placeholder="请输入关键字搜索" >
				<button class="search-button" onclick="javascript:search_name();"></button>
			</div>
			<?php
				$query3="select weixin_headimgurl,weixin_name from weixin_users where isvalid=true and customer_id=".$customer_id ." and weixin_fromuser='".$fromuser."' order by id desc limit 0,1";
				$result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());
				while ($row = mysql_fetch_object($result3))
				{
					$headimgurl = $row->weixin_headimgurl;
					$weixin_name= $row->weixin_name;
				}
			?>
			<style>
				.head_img{height:64px;width:64px;text-align:center;position:absolute;right:0px;z-index:99;top:0;border-bottom:1px solid #c9c9c9;border-left:1px solid #c9c9c9;border-radius: 0 0 0 5px;background: #fff;z-index:89;}
			</style>
			<div  style="position:absolute;right:63px;top:0;color:#000;font-size:12px;width:97px;overflow:hidden;text-align:right;z-index:99;background:#fff;height:42px;text-align:right;line-height:22px;">
				<p style="color:#000;font-size:12px;width:97px;overflow:hidden;"><?php echo $weixin_name;?></p>
				<p style="color:#000;font-size:12px;width:97px;overflow:hidden;">这是你的连锁超市</p>
			</div>
			<div class="head_img">
				<a href="../../mshop/personal_center.php?customer_id=<?php echo $customer_id_en;?>"><img src="<?php echo $headimgurl;?>" style="height:56px;width:56px;border-radius: 5px;margin-top:4px;"></a>
			</div>

			<!--<div class="shop_skin_index_list right-img" rel="edit-t02" no="1">
				<div class="img"></div>
			</div>
			-->
		</div><!--顶部结束-->
		<style>
			.f1{float:left;text-align:center;width:100%;display:block;line-height:40px;white-space: nowrap;overflow: hidden; text-overflow: ellipsis;}
		</style>
		<div class="left-side"><!--左边开始-->
			<div class="title-1">
			<div class="tbox-1">
				<!--<img src="../common/fengge51/images/icon-5.png" class="t-img">-->
				<div style="">
					<div class="shop_skin_index_list f1 ad " rel="edit-t04" no="3">
						<div class="div_typename" ></div>
					</div>


					<?php
					$tem_floor="select id,position,url from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=51 and isvalid=true and position >=16 and position <=18 order by CAST(position AS DECIMAL) asc";
					$result_tem_floor=_mysql_query($tem_floor) or die ('tem_floor faild ' .mysql_error());
					while($row=mysql_fetch_object($result_tem_floor)){
						$position=$row->position;
						$url=$row->url;
						//$position=($position<10)?("0".$position):($position);
						if($url){
					?>
						<div class="shop_skin_index_list f1" rel="edit-t<?php  echo $position; ?>" no="<?php echo $position-1?>">
							<a class="div_typename"></a>
						</div>

					<?php
						}}
					?>

					<div style="clear:both;"></div>
				</div>
			</div>
			</div>
			<div class="title-2">
				<span class="shop_skin_index_list f1 cf2" rel="edit-t19" no="18" onclick="getCatProduct(-1,<?php echo $customer_id;?>,<?php echo $owner_id;?>,1,0);$('#ajax_product').empty();page_num=0;">  <!--热卖-->
					<span class="div_typename" ></span>
				</span>
				<span class="shop_skin_index_list f1 cf2"  rel="edit-t20" no="19" onclick="getCatProduct(-1,<?php echo $customer_id;?>,<?php echo $owner_id;?>,2,0);$('#ajax_product').empty();page_num=0;"> <!--新品-->
					<span class="div_typename" ></span>
				</span>
				<!---<div class="tbox-2">


					<span class="shop_skin_index_list" rel="edit-t05" no="4">
						<span class="div_typename" ></span>
					</span>
					<img src="../common/fengge51/images/shang.png" class="icon-up">
				</div>

				-->

				<?php
					$cat_id=-1;
					$cat="select id,name from weixin_commonshop_types where is_shelves=true and isvalid=true and parent_id <0 and customer_id=".$customer_id;
					if(!empty($owner_typeids)){
						$cat = $cat." and id in (".$owner_typeids.")";
					}
					if($sort_str){
						$cat =$cat.' order by field(id'.$sort_str.')';
					}
					$result_cat=_mysql_query($cat) or die ("cat_query faild" .mysql_error());
					while($row=mysql_fetch_object($result_cat)){
						$cat_id=$row->id;
						$cat_name=$row->name;
				?>
					<div class="cf-box">
						<div class="cf1" ><?php echo $cat_name;?></div>
						<?php
							$cat_son="select id,name from weixin_commonshop_types where is_shelves=true and isvalid=true and top_id=".$cat_id." and customer_id=".$customer_id;
							$result_cat_son=_mysql_query($cat_son) or die ("cat_son_query faild" .mysql_error());
							while($row=mysql_fetch_object($result_cat_son)){
								$cat_son_id=$row->id;
								$cat_son_name=$row->name;
						?>
						<div class="cf2 bgf" onclick="getCatProduct(<?php echo $cat_son_id;?>,<?php echo $customer_id;?>,<?php echo $owner_id;?>,-1);$('#ajax_product').empty();page_num=0;count=0;"><?php echo $cat_son_name;?></div>
						<?php }?>
					</div>
					<?php }?>

				<div class="clear-fix50"></div>
			</div>
		</div><!--左边结束-->
		<div class="right-side"><!--右边开始-->
			<div id="part1">
				<?php
					$tem_floor="select id,position from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=51 and isvalid=true and ((POSITION >=6 AND POSITION <=15) OR (POSITION >=21 AND POSITION <=40) ) order by CAST(position AS DECIMAL) asc";

					$result_tem_floor=_mysql_query($tem_floor) or die ('tem_floor faild ' .mysql_error());
					while($row=mysql_fetch_object($result_tem_floor)){
						$position=$row->position;
						$position=($position<10)?("0".$position):($position);

				?>
					<div class="shop_skin_index_list" rel="edit-t<?php  echo $position; ?>" no="<?php echo $position-1?>">
						<div class="img"></div>
					</div>

				<?php
					}
				?>
				<div class="clear-fix50"></div>
			</div>
			<div id="part2">
				<div id="ajax_product"></div> <!--显示分类的产品-->

				<div class="clear-fix50"></div>
			</div>
		</div><!--右边开始-->
		<div class="bottom-side"><!--底部开始-->
		   <span class="cart"><a href="#" onclick="goToOrderCart(<?php echo $from_type;?>)"><img src="../common/fengge51/images/icon-7.png"></a></span>
			   <p class="cart-text">

			    <span id="toCart" style="font-size:14px;">

				</span>
			</p>
		   <?php
				$query = "select count(1) as count from weixin_commonshop_products where isvalid=true and isout=false and customer_id=".$customer_id;
				if(!empty($owner_typeids)){
				 //查找自己微店的产品
					 $query = $query." and (";
					 $owner_typeids_arr = explode(",",$owner_typeids);
					 $owner_typeids_count = count($owner_typeids_arr);
					 for($j=0;$j<$owner_typeids_count;$j++){
						 $o_typeid = $owner_typeids_arr[$j];
						 if($j==0){
							$query = $query."(LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }else{
							$query = $query." or ( LOCATE(',".$o_typeid.",', type_ids)>0)";
						 }
					 }
					 $query = $query.")";
				}

				$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
				while($row=mysql_fetch_object($result)){
					$allcount=$row->count;
				}
			?>
		   <p class="right-text"><a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>" style='font-size:13px;'>全部商品：<span style=""><?php echo $allcount;?></span>件</a></p>
		</div><!--底部结束-->

	</div>
	<script type="text/javascript" src="../common/js/order_type5.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/jquery-cookie.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../mshop/js/goods/index_add_cart.js" charset="utf-8"></script>
	<script type="text/javascript">
	var pro_card_level="<?php echo $pro_card_level;?>";//购买产品需要会员卡开关
	var shop_card_id="<?php echo $shop_card_id;?>";//会员卡ID
	var user_id="<?php echo $user_id;?>";
	var customer_id = '<?php echo $customer_id;?>';
	get_product_number(); //更新购物车商品数量
	function addToCart(is_QR,is_identity,is_virtual,pid,supply_id,pro_card_level_id){
        if(!checkUserLogin()) {
            return;
        }
	//if( from_type == 0 && user_id < 0 ){
	if(user_id < 0 ){
		document.location = "../../mshop/login.php?customer_id="+customer_id;
		return;
	}
	if( is_QR == 1 ){
		alert("二维码核销商品不能加入购物车");
		return;mshop
	}
	if( is_identity == 1){
		alert("身份证验证商品不能加入购物车");
		return;
	}
	if( is_virtual == 1 ){
		alert("虚拟商品不能加入购物车");
		return;
	}
	var pro_arr		= [];//产品信息数组：商品id、数量、属性
	var pro_arrs 	= [];//产品数组
	var sid_arr		= [];//商店数组
	var json_arr	= [];//整个购物车数组
	var pid 		= pid;//产品id
	var num 		= 1;//数量
	var supply_id 	= supply_id//供应商ID
//	var stock 		= $("#stock").text();//库存
	var pos_len 	= $(".active").length;
	var pos_arr 	= "";//选中属性id拼接字符串
	//check_storenum(pid); //检查库存
	//var aaa=check_proout(pid); //检查是否下架
	//console.log(aaa);
	if(check_proout(pid)==0){	//检查是否下架
		alert("商品已下架加入购物车失败！");
		return;
	}
	if(check_storenum(pid)==0){	//检查库存
		alert('库存不足加入购物车失败！');
		return;
	}

	if( pro_card_level == 1 && pro_card_level_id != -1){//检查会员卡是否有资格购买
		if(check_cardLevel(pro_card_level_id,shop_card_id)==0){
			alert('会员卡等级不足加入购物车失败！');
			return;
		}

	}

	for( i = 0; i < pos_len ; i++ ){
	var pos_id = $(".active").eq(i).attr("pos_id");
		if( pos_arr == "" ){
			pos_arr += pos_id;
		}else{
			pos_arr += "_"+pos_id;
		}
	}
	pro_arr.push(pid,num,pos_arr);
	//localStorage.clear();
	/*判断localStorage.cart是否存在开始*/
	if( !localStorage.getItem("cart_"+user_id) ){
		localStorage.setItem("cart_"+user_id,"");
	}
	/*判断localStorage.cart是否存在结束*/
	var json	= localStorage.getItem("cart_"+user_id);
	if(json != ""){
		json_arr = eval(json);
		var arr_sid = [];
		for( var i = 0; i < json_arr.length; i++){
			var sid = json_arr[i][0];//localStorage里的供应商id
			arr_sid.push(sid);
		}
		if( arr_sid.indexOf( supply_id ) > -1 ){
			for( var i = 0; i < json_arr.length; i++){
				var sid = json_arr[i][0];
				if( sid == supply_id ){
					var pid_arr = json_arr[i][1];
					var join = true;
					for( var j = 0; j < pid_arr.length; j++){
						var arr_pid = json_arr[i][1][j][0];//localStorage里的产品id
						var arr_pos = json_arr[i][1][j][2];//localStorage里的产品属性
						if( arr_pid == pid && arr_pos == pos_arr ){
							var arr_num = json_arr[i][1][j][1];//localStorage里的产品id
							var count = parseInt(arr_num)+parseInt(num);
							json_arr[i][1][j][1] = count;//修改数量
							 join = false;
							break;
						}

					}
					if( join ){
						json_arr[i][1].push(pro_arr);//对应供应商插入商品
					}
					break;
				}
			}
		}else{
			//插入新的供应商商品
			pro_arrs.push(pro_arr);
			sid_arr.push(supply_id,pro_arrs)
			json_arr.push(sid_arr);
		}
	}else{
		//插入新的供应商商品
		pro_arrs.push(pro_arr);
		sid_arr.push(supply_id,pro_arrs)
		json_arr.push(sid_arr);
	}

 	localStorage.setItem("cart_"+user_id,JSON.stringify(json_arr));
	get_product_number(); //更新购物车商品数量
	//console.log(json_arr);
	//console.log(localStorage.getItem("cart_"+user_id));

}

/*
	function add_cart(pid_id,now_price,need_score,is_supply_id){
		var customer_id='<?php echo $customer_id_en;?>';
		var score='<?php echo $score;?>';
		if(need_score>score){
			alert('加入购物车失败，积分不足');
			return false;
		}else{
			//var dataString = 'pid=' + pid_id + '&now_price=' + now_price + "&need_score=" + need_score + "&curr_num=" + 1 + "&customer_id=" + customer_id + "&sid=" + is_supply_id;
			url ='add_cart2.php?callback=jsonpCallback_addcart'
			+ '&pid=' + pid_id + "&now_price=" + now_price + "&need_score=" + need_score + "&curr_num=" + 1 + "&customer_id=" + customer_id + "&sid=" + is_supply_id;
			 $.ajax({
				type: "POST",
				url: url,
				success : function(json) {
					var o = JSON.parse(json);
					var l = o.len;
					//alert('加入购物车成功！');
					if (parseInt(l) > 0) {
						if ($("#toCart i").length == 0) {
							$("#toCart").prepend("<i></i>")
						}
						$("#toCart").empty();
						$("#toCart").append('购物车有<i> '+l+' </i>件商品');
					}
				},
				error : function(json) {
					alert('加入购物车失败！');
				}
			});

		}

	}*/
	var page_num=0;
	function getCatProduct(cat_id,customer_id,owner_id,type_id,page_num){
		document.cookie="a="+cat_id;
		document.cookie="b="+customer_id;
		document.cookie="c="+owner_id;
		document.cookie="d="+type_id;
		//$("#ajax_product").empty();
	//	var dataString = 'cat_id='+ cat_id + '&customer_id=' + customer_id+ '&owner_id='+owner_id;
		$.ajax({
			type : "POST",
			url : "get_catproduct.php",
			data : {"cat_id" : cat_id,"customer_id" : customer_id,"owner_id" : owner_id,"type_id" : type_id,"page_num" : page_num },
			dataType: "json",
			success : function(result) {
				if ( result.code==0 ) {
					var str="";
					for(var i=0;i<=result.num-1;i++){
						str+=' <div class="pro-box">';

						str+='<a href="../../mshop/product_detail.php?pid='+result.msg[i].pid+'&customer_id='+customer_id+'">';
						str+=' <img src="'+result.msg[i].default_imgurl+'" class="i1">';
						str+='</a>';
						str+=' <div class="add">';
						str+=' <img src="../common/fengge51/images/add.png"  onclick="addToCart('+result.msg[i].is_QR+','+result.msg[i].is_identity+','+result.msg[i].is_virtual+','+result.msg[i].pid+','+result.msg[i].is_supply_id+','+result.msg[i].pro_card_level_id+');" pid='+result.msg[i].pid+'>';
						str+=' </div>';
						str+=' </div>';

					}
					document.cookie="count="+result.num;
					$("#ajax_product").append(str);
				} else {
					$("#ajax_product").text(result.msg);
				}
			}

		});

	}



	$(document).ready(function(){

		var window_width=$(window).width();
		$(".d-box img").css("width",window_width*0.64+"px");
		$(".d-box img").css("height",window_width*0.64/2+"px");
	})
	$(function(){
		$(window).resize(function(){
		    var wh=$(window).height()-43;
            $('.left-side').height(wh);
            $('.right-side').height(wh);
            $('.title-2').height(wh-41);
		});
		$(window).resize();
        $(".cf2").click(function(){
        	var pIndex=$(this).parent().index()
        	setCookie($(this).index(),pIndex);
        	clickThis($(this).index(),pIndex);
        });
        $(".cf1").click(function(){
        	$(this).parent().find('.cf2').slideToggle();
        });
        $('.tbox-1 .ad').click(function(){
            $('.tbox-1').removeClass('grey-bg');
            $('.title-2').removeClass('br0');
            $('.cf2').removeClass('foc');
            $('#part1').show();
            $('#part2').hide();
            $.cookie('son', 'part1');
        });
        $('.tbox-2').click(function(){
            $('.icon-up').toggleClass('up-down');
            $('.con-box').slideToggle();
        })

		var son=$.cookie('son');
		var father=$.cookie('father');
		var a=$.cookie('a');
		var b=$.cookie('b');
		var c=$.cookie('c');
		var d=$.cookie('d');
		var count=$.cookie('count');
		if(son=="part1"){
			console.log("~");
		}
		else	if(son){
				clickThis(son,father);
				getCatProduct(a,b,c,d);
				page_num=0;
			}


		$(".right-side").scroll(function() {
			 var wh=$(window).height()-43;
			if ($(".right-side").scrollTop() + wh >= $("#part2").height()-200) {
				page_num=page_num+1;
				aa=$(".right-side").scrollTop();
				bb=$("#part2").height();

				//console.log("count1"+count);
				//console.log("cat_id."+a);
				if(aa>50 && count>=19){
				//	alert(aa);
					document.cookie="count="+0;
					getCatProduct(a,b,c,d,page_num);
				//	console.log("count2"+count);
				}
			}
		});

			});
		function setCookie(son,father){
			document.cookie="son="+son;
			document.cookie="father="+father;
		}
		function clickThis(son,father){
			$('.cf2').removeClass('foc');
			$('.cf-box').eq(father-2).find(".cf2").eq(son-1).addClass('foc');
            $('.tbox-1').addClass('grey-bg');
            $('#part1').hide();
            $('#part2').show();
            $('.title-2').addClass('br0');
		}
	</script>
</div>

<?php }else if($template_id==52){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>;"<?php } ?> >


	<div class="main">
		<div class="title" id="title" style=""><!--搜索开始-->
			<div class="shop_skin_index_list  img1" rel="edit-t01" no="0">
				<div class="img" ></div>
			</div>
			<div class="search-layer">

				<input type="text" class="search-input" id="searchname" name="searchname" onkeydown="if(event.keyCode==13){search_name();}" placeholder="快时尚社交电商平台" >
				<button class="search-button" onclick="javascript:search_name();"></button>
			</div>
			<div class="shop_skin_index_list  img3" rel="edit-t02" no="1">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list  img2" rel="edit-t03" no="2">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list  img-bg" rel="edit-t04" no="3">
				<div class="img" ></div>
			</div>

		</div><!--搜索结束-->
		<div class="shop_skin_index_list  scroll" rel="edit-t05" no="4" style="margin-top:35px;">
			<div class="img" ></div>
		</div>

		<div class="cl-box"><!--开始-->
			<div class="cl">
				<div class="shop_skin_index_list" rel="edit-t06" no="5">
					<div class="img" ></div>
				</div>
				<!--<p>
					<div class="shop_skin_index_list" rel="edit-t11" no="10">
						<div class="div_typename" ></div>
					</div>
				</p>
				-->
			</div>
			<div class="cl">
				<div class="shop_skin_index_list" rel="edit-t07" no="6">
					<div class="img" ></div>
				</div>
				<!--
				<p>
					<div class="shop_skin_index_list" rel="edit-t12" no="11">
						<div class="div_typename" ></div>
					</div>
				</p>
				-->
			</div>
			<div class="cl">
				<div class="shop_skin_index_list" rel="edit-t08" no="7">
					<div class="img" ></div>
				</div>
				<!--
				<p>
					<div class="shop_skin_index_list" rel="edit-t13" no="12">
						<div class="div_typename" ></div>
					</div>
				</p>
				-->
			</div>
			<div class="cl">
				<div class="shop_skin_index_list" rel="edit-t09" no="8">
					<div class="img" ></div>
				</div>
				<!--
				<p>
					<div class="shop_skin_index_list" rel="edit-t14" no="13">
						<div class="div_typename" ></div>
					</div>
				</p>
				-->
			</div>
			<div class="cl">
				<div class="shop_skin_index_list" rel="edit-t10" no="9">
					<div class="img" ></div>
				</div>
				<!--
				<p>
					<div class="shop_skin_index_list" rel="edit-t15" no="14">
						<div class="div_typename" ></div>
					</div>
				</p>
				-->
			</div>
			<div class="clear"></div>
		</div><!--图标结束-->

		<div class="con-box"><!--广告1开始-->
			<div class="shop_skin_index_list con1" rel="edit-t16" no="15">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list con2" rel="edit-t17" no="16">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list con3" rel="edit-t18" no="17">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list con4" rel="edit-t19" no="18">
				<div class="img" ></div>
			</div>

			<div class="clear"></div>
		</div><!--广告1结束-->
		<!--10张广告图开始-->
		<?php
			$tem_floor="select id,position from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=52 and isvalid=true and ((POSITION >=20 AND POSITION <=29) OR (POSITION >=69 AND POSITION <=118) ) order by position asc";
			$result_tem_floor=_mysql_query($tem_floor) or die ('tem_floor faild ' .mysql_error());
			while($row=mysql_fetch_object($result_tem_floor)){
				$position=$row->position;


		?>
			<div class="shop_skin_index_list banner" rel="edit-t<?php echo $position?>" no="<?php echo $position-1?>">
				<div class="img"></div>
			</div>

		<?php
			}
		?>
		<!--<div class="shop_skin_index_list banner" rel="edit-t20" no="19">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list banner" rel="edit-t21" no="20">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list banner" rel="edit-t22" no="21">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list banner" rel="edit-t23" no="22">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list banner" rel="edit-t24" no="23">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list banner" rel="edit-t25" no="24">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list banner" rel="edit-t26" no="25">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list banner" rel="edit-t27" no="26">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list banner" rel="edit-t28" no="27">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list banner" rel="edit-t29" no="28">
			<div class="img" ></div>
		</div>
		-->
		<!--10张广告图结束-->
		<!--广告坑1开始-->
		<div class="shop_skin_index_list img-title" rel="edit-t30" no="29">
			<div class="img" ></div>
		</div>
		<div class="de-box">
			<div class="shop_skin_index_list de100" rel="edit-t31" no="30">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de-l" rel="edit-t32" no="31">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de-r" rel="edit-t33" no="32">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de-r" rel="edit-t34" no="33">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t35" no="34">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t36" no="35">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t37" no="36">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t38" no="37">
				<div class="img" ></div>
			</div>
			<div class="clear"></div>
		</div>
		<!--广告坑1结束-->
		<!--广告坑2开始-->
		<div class="shop_skin_index_list img-title" rel="edit-t39" no="38">
			<div class="img" ></div>
		</div>
		<div class="de-box">
			<div class="shop_skin_index_list de100" rel="edit-t40" no="39">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de-l" rel="edit-t41" no="40">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de-r" rel="edit-t42" no="41">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de-r" rel="edit-t43" no="42" >
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t44" no="43">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t45" no="44" >
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t46" no="45">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t47" no="46">
				<div class="img" ></div>
			</div>
			<div class="clear"></div>
		</div>
		<!--广告坑2结束-->
		<!--广告坑3开始-->
		<div class="shop_skin_index_list img-title" rel="edit-t48" no="47">
			<div class="img" ></div>
		</div>
		<div class="de-box">
			<div class="shop_skin_index_list de100" rel="edit-t49" no="48">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de-l" rel="edit-t50" no="49">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de-r" rel="edit-t51" no="50">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de-r" rel="edit-t52" no="51">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t53" no="52">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t54" no="53">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t55" no="54">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list de25" rel="edit-t56" no="55">
				<div class="img" ></div>
			</div>
			<div class="clear"></div>
		</div>
		<!--广告坑3结束-->

		<!--广告坑6开始-->  <!--权客户要求加，请勿打包进去！！！！！1-->
		<!--
	<div class="shop_skin_index_list img-title" rel="edit-t119" no="118">
		<div class="img" ></div>
	</div>
	<div class="de-box">
		<div class="shop_skin_index_list de100" rel="edit-t120" no="119">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de-l" rel="edit-t121" no="120">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de-r" rel="edit-t122" no="121">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de-r" rel="edit-t123" no="122">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t124" no="123">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t125" no="124">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t126" no="125">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t127" no="126">
			<div class="img" ></div>
		</div>
		<div class="clear"></div>
	</div>
	-->
	<!--广告坑6结束-->	 <!--权客户要求加，请勿打包进去！！！！！1-->
	<!--广告坑7开始-->  <!--权客户要求加，请勿打包进去！！！！！1-->
	<!--
	<div class="shop_skin_index_list img-title" rel="edit-t128" no="127">
		<div class="img" ></div>
	</div>
	<div class="de-box">
		<div class="shop_skin_index_list de100" rel="edit-t129" no="128">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de-l" rel="edit-t130" no="129">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de-r" rel="edit-t131" no="130">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de-r" rel="edit-t132" no="131">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t133" no="132">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t134" no="133">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t135" no="134">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t136" no="135">
			<div class="img" ></div>
		</div>
		<div class="clear"></div>
	</div>
	-->
	<!--广告坑7结束-->	 <!--权客户要求加，请勿打包进去！！！！！1-->
	<!--广告坑8开始-->  <!--权客户要求加，请勿打包进去！！！！！1-->
	<!--
	<div class="shop_skin_index_list img-title" rel="edit-t137" no="136">
		<div class="img" ></div>
	</div>
	<div class="de-box">
		<div class="shop_skin_index_list de100" rel="edit-t138" no="137">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de-l" rel="edit-t139" no="138">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de-r" rel="edit-t140" no="139">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de-r" rel="edit-t141" no="140">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t142" no="141">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t143" no="142">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t144" no="143">
			<div class="img" ></div>
		</div>
		<div class="shop_skin_index_list de25" rel="edit-t145" no="144">
			<div class="img" ></div>
		</div>
		<div class="clear"></div>
	</div>
	-->
	<!--广告坑8结束-->  <!--权客户要求加，请勿打包进去！！！！！1-->



		<!--广告坑4开始-->
		<div class="shop_skin_index_list img-title" rel="edit-t58" no="57">
			<div class="img" ></div>
		</div>
		<div class="dh-box">
			<div class="shop_skin_index_list dh-img" rel="edit-t59" no="58">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list dh-img" rel="edit-t60" no="59">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list dh-img" rel="edit-t61" no="60" >
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list dh-img" rel="edit-t62" no="61">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list dh-img" rel="edit-t63" no="62">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list dh-img" rel="edit-t64" no="63">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list dh-img" rel="edit-t65" no="64">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list dh-img" rel="edit-t66" no="65">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list dh-img" rel="edit-t67" no="66">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list dh-img" rel="edit-t68" no="67">
				<div class="img" ></div>
			</div>
			<div class="clear"></div>
		</div>
		<!--广告坑4结束-->
		<!--底部广告图开始-->
		<div class="shop_skin_index_list banner-b" rel="edit-t57" no="56">
			<div class="img" ></div>
		</div>
		<!--底部广告图结束-->
	</div>
	<script type="text/javascript">
		$(function(){
			function func(){
				var ww=$(window).width()-140;
				window_width=$(window).width();
				$('.search-layer').width(ww);
				 $('.con3 img').height($('.con4 img').height());
				$('.con1 img').height($('.con2 img').height()+$('.con3 img').height()+1);

					$('.de-l img').height($('.de-r img').height()+$('.de-r img').height()+2);

			}
			window.onload=func;
		});
	</script>
	<style>
		.foot_img img {width:60px;}
	</style>
	<?php
		$supporttype=-1; //1代表商城名字 2 代表公众号名字
		$supportname="";
		$support_fontcolor="";
		$support_linkurl="";
		$supportImg="";

		$support_query="select supporttype,supportname,support_fontcolor,support_linkurl,supportImg from customers where id=".$customer_id."";
		$result_support=_mysql_query($support_query) or die ('support_query faild' .mysql_error());
		while($row=mysql_fetch_object($result_support)){
			$supporttype=$row->supporttype;
			$supportname1=$row->supportname;
			$support_fontcolor=$row->support_fontcolor;
			$support_linkurl=$row->support_linkurl;
			$supportImg=$row->supportImg;
			}
		switch ($supporttype){
			case 1:
				$support_name="select name from weixin_commonshops where customer_id=".$customer_id."";
				$result_supportname=_mysql_query($support_name) or die ('support_name faild' .mysql_error());
				while($row=mysql_fetch_object($result_supportname)){
					$supportname=$row->name;
					}
				break;
			case 2:
				$support_name="select weixin_name from weixin_baseinfos where customer_id=".$customer_id."";
				$result_supportname=_mysql_query($support_name) or die ('support_name faild' .mysql_error());
				while($row=mysql_fetch_object($result_supportname)){
					$supportname=$row->weixin_name;
					}

				break;
			case 3:
				$supportname=$supportname1;
				break;
			}
		if($supportname){
	?>

		<div class="" style="width:100%;display:block;padding:18px 0px;">
			<section class="members_goodspic" style="margin-top:0px!important;">
				<?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
				<div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
			</section>
		</div>
		<?php }?>
</div>
<?php }else if($template_id==53){
	$city_id=-1;
	$city_name = "";
	$set_city_name = "";

	//默认北京市的经纬度
	$longitude = 116.413554;
	$latitude = 39.911013;
	//默认北京市的经纬度 End

	if(!empty($_GET["city_id"])){
		$city_id = $configutil->splash_new($_GET["city_id"]);
	}

	//默认IP所在城市
	$ip_city = "北京市";

    //该模板有定位，当是h5小程序跳转过来，引入定位文件
    if(isset($_SESSION["from_type_mini_".$customer_id])){
       $from_type_mini = (int)$_SESSION["from_type_mini_".$customer_id];

       if($from_type_mini == 5){
         require_once($_SERVER['DOCUMENT_ROOT'].'/mp/geolocation.php');
       }  
    }
    
	$commonutil = new CommonUtiliy();
	$ip = $commonutil->get_real_ip();
	$ip_address = $commonutil->getCity($ip);
	if($ip_address){
		$ip_city = $ip_address['city'];
	}
	//默认IP所在城市End

	if(!empty($_GET["loca_city"])){
		$_SESSION['city_name'] = $configutil->splash_new($_GET["loca_city"]);
	}
	if(!empty($_GET["search_name"])){
		$search_name = $configutil->splash_new($_GET["search_name"]);
	}

	if($city_id>0){    //手动选择城市
		$query = "SELECT add_c FROM weixin_cityarea_supply where id=".$city_id;
		$result = _mysql_query($query) or die ('citypy_query faild' .mysql_error());
		while($row = mysql_fetch_object($result)){
			$set_city_name = $row->add_c;
		}
		$_SESSION['city_name'] = $set_city_name;
	}

	if(!empty($_GET["city_name"])){    //自动定位城市
		$city_name = $configutil->splash_new($_GET["city_name"]);
		$_SESSION['city_name'] = $city_name;
	}

	if(!empty($_GET["longitude"])){
		$longitude = $configutil->splash_new($_GET["longitude"]);
		$_SESSION['longitude'] = $longitude;
	}

	if(!empty($_GET["latitude"])){
		$latitude = $configutil->splash_new($_GET["latitude"]);
		$_SESSION['latitude'] = $latitude;
	}
?>


<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>;"<?php } ?> >
	<div class="main">
		<div class="zhezhao" id="zhezhao"></div>
		<div class="zhezhao_loc" id="zhezhao_loc"></div>
		<div class="loading" id="loading"><span>定位中...</span></div>
		<div class="header">
		<div class="head_left">
			<?php if(!empty($_SESSION['city_name'])){?>
			<input type="button" name="location" id="location" value="<?php echo str_replace("市","",$_SESSION['city_name']); ?>" />
			<?php }else{?>
			<input type="button" name="location" id="location" value="<?php echo str_replace("市","",$ip_city); ?>" />
			<?php }?>
			<img class="arr" src="../common/fengge53/images/arr.png"/>
		</div>
		<div class="search">
			<input type="text" id="search_shop" placeholder="输入关键词" />
			<img class="se" src="../common/fengge53/images/se.png"/>
		</div>
		<div class="head_right"><img class="loc" src="../common/fengge53/images/loc.png"/></div>
		</div>

		<!-- 点击搜索框时激活 start -->
		<div class="s_header" style="display:none;">
		<div class="s_search">
			<input type="text" name="s_search_shop" id="s_search_shop" placeholder="输入关键词" />
			<img class="s_se" src="../common/fengge53/images/se.png"/>
		</div>
		<input type="button" class="searchForm" onclick="searchForm();" value="搜索">
		</div>
		<!-- 点击搜索框时激活 end -->

		<!-- 轮播图 start -->
		<div class="homebanner" id="homebanner">
			<div class="shop_skin_index_list banner" rel="edit-t01" no="0">
				<div class="img" ></div>
			</div>
		</div>
		<!-- 轮播图 end -->

		<div class="type_box">
		<div class="box">
			<div class="shop_skin_index_list" rel="edit-t02" no="1">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t10" no="9">
				<div class="div_typename" ></div>
			</div>
		</div>
		<div class="box">
			<div class="shop_skin_index_list" rel="edit-t03" no="2">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t11" no="10">
				<div class="div_typename" ></div>
			</div>
		</div>
		<div class="box">
			<div class="shop_skin_index_list" rel="edit-t04" no="3">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t12" no="11">
				<div class="div_typename" ></div>
			</div>
		</div>
		<div class="box">
			<div class="shop_skin_index_list" rel="edit-t05" no="4">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t13" no="12">
				<div class="div_typename" ></div>
			</div>
		</div>
		<div class="box">
			<div class="shop_skin_index_list" rel="edit-t06" no="5">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t14" no="13">
				<div class="div_typename" ></div>
			</div>
		</div>
		<div class="box">
			<div class="shop_skin_index_list" rel="edit-t07" no="6">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t15" no="14">
				<div class="div_typename" ></div>
			</div>
		</div>
		<div class="box">
			<div class="shop_skin_index_list" rel="edit-t08" no="7">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t16" no="15">
				<div class="div_typename" ></div>
			</div>
		</div>
		<div class="box">
			<div class="shop_skin_index_list" rel="edit-t09" no="8">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t17" no="16">
				<div class="div_typename" ></div>
			</div>
		</div>
		</div>

		<!-- 页面中部广告位 start -->
		<div class="ad">
			<div class="shop_skin_index_list ad1" rel="edit-t18" no="17">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list ad1" rel="edit-t19" no="18">
				<div class="img" ></div>
			</div>
		</div>
		<!-- 页面中部广告位 end -->

		<div class="main_type">
			<div class="type foc">
				<span>附近商家</span>
			</div>
			<!--
			<div class="type">
				<span>线上商家</span>
			</div>
			<div class="type">
				<span>附近白给</span>
			</div>
			<div class="type">
				<span>附近活动</span>
			</div>
			-->
		</div>

		<div class="main" id="main">

		</div>
	</div>
</div>
<?php include_once($_SERVER['DOCUMENT_ROOT'].'/mp/geolocation.php'); ?>
<script type="text/javascript">

	// var geolocation = new qq.maps.Geolocation("KVLBZ-LJUKF-LGQJZ-J2IGO-FGNF5-XCBJH", "mapqq");
var latitude = '<?php echo empty($_SESSION['latitude']) ? $latitude : $_SESSION['latitude'];?>';
var longitude = '<?php echo empty($_SESSION['longitude']) ? $longitude : $_SESSION['longitude'];?>';
$(function(){
	$('.type').on('click',function(){
		$(this).addClass('foc').siblings('.type').removeClass('foc');
	});
	SetWidth();      //自动切换搜索栏宽度
	b_SetHeight();   //自动切换幻灯片高度
	ad_SetHeight();  //自动切换广告图高度
	<!-- 弹出遮罩，显示搜索栏 start -->
	$('#search_shop').click(function(){
		$('.header').hide();
		$('.s_header').show();
		$('#zhezhao').show();
		$('input[name=s_search_shop]').focus();

		/* 自动切换搜索栏宽度 */
		s_SetWidth();

		/* 禁止手机滚动条滚动 */
		$('body').on('touchmove', function (event) {
			event.preventDefault();
		});
	});

	$('#zhezhao').click(function(){
		$('.s_header').hide();
		$('.header').show();
		$('#zhezhao').hide();

		/* 恢复手机滚动条滚动 */
		$("body").unbind("touchmove");
	});
	<!-- 弹出遮罩，显示搜索栏 end -->

	<!-- 选择城市 -->
	$('#location').click(function(){
		var url = "select_city_fengge53.php?op=1&customer_id=<?php echo $customer_id_en; ?>&latitude="+latitude+"&longitude="+longitude;
		document.location = url;
	});
	var city_id = <?php echo $city_id;?>;
	/* if(city_id>0){
		var city = '<?php echo $city_name;?>';
		$('#location').val(city);
		SetWidth();     //自动切换搜索栏宽度
	} */


	//进首页先定位
    var set_city_name ='<?php echo $_SESSION['city_name']?>';
	var is_locate ='<?php echo $_REQUEST['is_locate']?>';
	if( set_city_name=='' && is_locate!=1 ){
		$('#loading').show();
		$('#zhezhao_loc').show();
		getLocation(1);
		setTimeout(function(){$('#loading').hide();}, 30000);
		setTimeout(function(){$('#zhezhao_loc').hide();},30000);
	}


	$('.loc').click(function(){		//点击定位
		$('#loading').show();
		$('#zhezhao_loc').show();
		/* 禁止手机滚动条滚动 */
		$('body').on('touchmove', function (event) {
			event.preventDefault();
		});
		getLocation(1);
	});


	get_detail(longitude,latitude);	//获取商品数据

});




function golocation(){
	if( typeof(location_info.city)=="undefined" ){
		location_info.city = '';
	}
    var is_locate = 1;
	url='index.php?customer_id=<?php echo $customer_id_en;?>&city_name='+location_info.city+'&latitude='+location_info.lat+'&longitude='+location_info.lng+'&is_locate='+is_locate;
    console.log(url)
	<?php if($exp_user_id>0){ ?>
	url = url + '&exp_user_id=<?php echo $exp_user_id;?>';
	<?php } ?>
	<?php if($owner_id>0){ ?>
	url = url + '&owner_id=<?php echo $owner_id;?>';
	<?php } ?>
	window.location.href=url;
}






<!-- 获取商品数据 start -->
var page=0;
function get_detail(longitude,latitude){
 $.ajax({
    url: "get_detail_fengge53.php?op=1&customer_id=<?php echo $customer_id_en;?>&user_id=<?php echo passport_encrypt($user_id);?>&search_name=<?php echo $search_name;?>&search_city=<?php echo $_SESSION['city_name'] ? $_SESSION['city_name'] : $ip_city;?>",
    dataType: 'html',
    data: {
		"page": page,
		"longitude": longitude,
		"latitude": latitude,
		"search_name": '<?php echo $search_name;?>'
		},
        type: "post",
 		async: true,
        success: function (data){
			if(data == 'no'){
				loadmore_status = 0;
			}else{
            $("#main").append(data);
			}
        }
     });
};

var loadmore_status = 1;
function loadmore(){
	if(loadmore_status){
		page=page+1;
		get_detail(longitude,latitude);
	}else{
		console.log('no more');
	}

}

$(function(){
    var winH = $(window).height(); //页面可视区域高度
    var i = 1; //设置当前页数
    $(window).scroll(function () {
        var pageH = $(document.body).height();
        var scrollT = $(window).scrollTop(); //滚动条top
        var aa = (pageH-winH-scrollT)/winH;
        if(aa<0.3){
        	loadmore();
        }
    })
});
<!-- 获取商品数据 end -->

function searchForm(){
	var loca_city = '<?php echo $city_name;?>';
	var search_name = $('#s_search_shop').val();
	var url = "index.php?customer_id=<?php echo $customer_id_en;?>&city_id=<?php echo $city_id;?>&latitude="+latitude+"&longitude="+longitude+"&loca_city="+loca_city+"&search_name="+search_name;
	document.location = url;
}

<!-- 自动切换长宽 start -->
function SetWidth(){
	var head_width = $(".header").width();
	var l_width = $(".head_left").width();
	var r_width = $(".head_right").width();
	var search_width = head_width - l_width - r_width - 61;
	$(".search").width(search_width);
}

function s_SetWidth(){
	var s_head_width = $(".s_header").width();
	var s_r_width = $(".searchForm").width();
	var s_search_width = s_head_width - s_r_width - 46;
	$("#s_search_shop").width(s_search_width);
}

function b_SetHeight(){
	var b_width = $(".homebanner").width();
	var b_height = b_width/2;
	$(".homebanner").height(b_height);
	$(".homebanner img").height(b_height);
}

function ad_SetHeight(){
	var ad_width = $(".ad img").width();
	var ad_height = ad_width/2;
	$(".ad img").height(ad_height);
	$(".ad").height(ad_height);
}
<!-- 自动切换长宽 end -->
</script>
<?php }else if($template_id==54){?>  <!--浪莎专用模板-->
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>;"<?php } ?> >
	<div class="main">
		<div class="shop_skin_index_list  scroll" rel="edit-t01" no="0">
			<div class="img" ></div>
		</div>
		<div class="cl-box">
			<div class="cl">
				<div class="shop_skin_index_list" rel="edit-t02" no="1">
					<div class="img" ></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t07" no="6">
					<div class="div_typename" ></div>
				</div>
			</div>
			<div class="cl">
				<div class="shop_skin_index_list" rel="edit-t03" no="2">
					<div class="img" ></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t08" no="7">
					<div class="div_typename" ></div>
				</div>
			</div>
			<div class="cl">
				<div class="shop_skin_index_list" rel="edit-t04" no="3">
					<div class="img" ></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t09" no="8">
					<div class="div_typename" ></div>
				</div>
			</div>
			<div class="cl">
				<div class="shop_skin_index_list" rel="edit-t05" no="4">
					<div class="img" ></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t10" no="9">
					<div class="div_typename" ></div>
				</div>
			</div>
			<div class="cl">
				<div class="shop_skin_index_list" rel="edit-t06" no="5">
					<div class="img" ></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t11" no="10">
					<div class="div_typename" ></div>
				</div>
			</div>

			<div class="clear"></div>
		</div>
		<div class="search-layer">
			<img src="../common/fengge54/images/search.png" class="search-icon" onclick="javascript:search_name();">
			<span style="border-right:1px solid #9fa0a0;float:left;height:15px;margin:9px 5px 0px 5px;"></span>
			<input type="text" class="search-input" id="searchname" name="searchname" onkeydown="if(event.keyCode==13){search_name();}" placeholder="搜索你想要的商品" >
			<!--<button class="search-button"></button>-->
		</div>
		<div class="zt-box">
			<div class="shop_skin_index_list img1" rel="edit-t12" no="11">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list left-img" rel="edit-t13" no="12">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list right-top-img" rel="edit-t14" no="13">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list right-bottom-img" rel="edit-t15" no="14">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list img1" rel="edit-t16" no="15">
				<div class="img" ></div>
			</div>

			<!--6个自定义产品位开始-->
			<div class="pro-box">
				<?php
					$tem_floor="select id,position from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=54 and isvalid=true and position >=17 and position <=22 order by position asc";
					$result_tem_floor=_mysql_query($tem_floor) or die ('tem_floor faild ' .mysql_error());
					while($row=mysql_fetch_object($result_tem_floor)){
						$position=$row->position;
				?>
					<div class="shop_skin_index_list pro" rel="edit-t<?php echo $position?>" no="<?php echo $position-1?>">
						<div class="img"></div>
					</div>
				<?php
					}
				?>
				<div class="clear"></div>
			</div>
			<!--6个自定义产品位结束-->
		</div>
		<!--8个广告位开始-->
		<?php
			$tem_floor="select id,position from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=54 and isvalid=true and position >=23 and position <=30 order by position asc";
			$result_tem_floor=_mysql_query($tem_floor) or die ('tem_floor faild ' .mysql_error());
			while($row=mysql_fetch_object($result_tem_floor)){
				$position=$row->position;
		?>
			<div class="shop_skin_index_list banner" rel="edit-t<?php echo $position?>" no="<?php echo $position-1?>">
				<div class="img"></div>
			</div>
		<?php
			}
		?>
		<!--8个广告位结束-->

		<!--三个广告位开始-->
		<div class="p-box">
			<div class="shop_skin_index_list p1" rel="edit-t31" no="30">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list p2" rel="edit-t32" no="31">
				<div class="img" ></div>
			</div>
			<div class="shop_skin_index_list p2" rel="edit-t33" no="32">
				<div class="img" ></div>
			</div>
		</div>
		<!--三个广告位结束-->


			<div class="br-box">
			<?php
				$cat="select id,name,imgurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and parent_id=31";

				$cat=$cat." order by id desc limit 0,3";
				$result_cat=_mysql_query($cat) or die ("cat_query faild" .mysql_error());
				while($row=mysql_fetch_object($result_cat)){
					$cat_parid=$row->id;
					$cat_parname=$row->name;
					$cat_parimgurl=$row->imgurl;

			?>
				<a href="../../mshop/list.php?tid=<?php echo $cat_parid; ?>&tname=<?php echo $cat_parname; ?>&customer_id=<?php echo $customer_id_en; ?>"><img src="<?php echo $new_baseurl.$cat_parimgurl;?>"></a>
			<?php }?>	<!--子级分类图片显示-->
				<span>
					<div class="shop_skin_index_list" rel="edit-t76" no="75" >
						<a class="div_typename" ></a>
					</div>
				</span>
			</div>

		<div class="c-box">
			<!--32个广告位开始-->
			<?php
				$tem_floor_32="select id,position from weixin_commonshop_template_item_imgs where customer_id=".$customer_id." and template_id=54 and isvalid=true and position >=44 and position <=75 order by position asc";
				$result_tem_floor_32=_mysql_query($tem_floor_32) or die ('tem_floor_32 faild ' .mysql_error());
				while($row=mysql_fetch_object($result_tem_floor_32)){
					$position=$row->position;
			?>
				<div class="shop_skin_index_list c-box-img" rel="edit-t<?php echo $position?>" no="<?php echo $position-1?>">
					<div class="img"></div>
				</div>

			<?php
				}
			?>
			<!--32个广告位结束-->
		</div>




		<style>
		.foot_img img {width:60px;}
		</style>
		<?php
			$supporttype=-1; //1代表商城名字 2 代表公众号名字
			$supportname="";
			$support_fontcolor="";
			$support_linkurl="";
			$supportImg="";

			$support_query="select supporttype,supportname,support_fontcolor,support_linkurl,supportImg from customers where id=".$customer_id."";
			$result_support=_mysql_query($support_query) or die ('support_query faild' .mysql_error());
			while($row=mysql_fetch_object($result_support)){
				$supporttype=$row->supporttype;
				$supportname1=$row->supportname;
				$support_fontcolor=$row->support_fontcolor;
				$support_linkurl=$row->support_linkurl;
				$supportImg=$row->supportImg;
				}
			switch ($supporttype){
				case 1:
					$support_name="select name from weixin_commonshops where customer_id=".$customer_id."";
					$result_supportname=_mysql_query($support_name) or die ('support_name faild' .mysql_error());
					while($row=mysql_fetch_object($result_supportname)){
						$supportname=$row->name;
						}
					break;
				case 2:
					$support_name="select weixin_name from weixin_baseinfos where customer_id=".$customer_id."";
					$result_supportname=_mysql_query($support_name) or die ('support_name faild' .mysql_error());
					while($row=mysql_fetch_object($result_supportname)){
						$supportname=$row->weixin_name;
						}

					break;
				case 3:
					$supportname=$supportname1;
					break;
				}
			if($supportname){
		?>

		<div class="" style="width:100%;display:block;padding:18px 0px;">
			<section class="members_goodspic" style="margin-top:0px!important;">
				<?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
				<div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
			</section>
		</div>
		<?php }?>
		<?php if($is_showbottom_menu){
		/*<div style="display:block;height:55px;width:100%;"></div>
		<div class="footer">
			<div class="footer-box">
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t34" no="33">
						<div class="img" ></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t39" no="38">
						<div class="div_typename" ></div>
					</div>
				</div>
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t35" no="34">
						<div class="img" ></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t40" no="39">
						<div class="div_typename" ></div>
					</div>
				</div>
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t36" no="35">
						<div class="img" ></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t41" no="40">
						<div class="div_typename" ></div>
					</div>
				</div>
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t37" no="36">
						<div class="img" ></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t42" no="41">
						<div class="div_typename" ></div>
					</div>
				</div>
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t38" no="37">
						<div class="img" ></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t43" no="42">
						<div class="div_typename" ></div>
					</div>
				</div>

			</div>
		</div>*/
		/*判断是否显示底部菜单 start*/
		require_once('../../common/utility_setting_function.php');
		$fun = "index";
		$is_publish = check_is_publish(2,$fun,$customer_id);

		if($is_publish){
			require_once('../../mshop/bottom_label.php');
		}
		/*判断是否显示底部菜单 end*/
		 }?>
	</div>
</div>
<script type="text/javascript">

$(function(){
		function func(){
			var two_height=$('.right-top-img').find('img').height()+$('.right-bottom-img').find('img').height();
		$('.left-img').find('img').height(two_height);
		var two_h=$('.p2').find('img').height()
		$('.p1').find('img').height(two_h);

		var win_width=$(window).width();
		$('.c-box-img img').css("height",win_width*340/265/4+"px");
		}
		window.onload=func;
	});


</script>

<?php }else if($template_id==55){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>"<?php } ?>>
	<div class="main">
		<div class="search-box">
			<div class="shop_skin_index_list"  rel="edit-t01" no="0">
				<div class="img"></div>

			</div>
			<script>
				window.onload = function(){
					var search_img_height = $('.search-box img').css('height');	//解决搜索栏背景图高度问题	by lzw 2016-11-11
					$('.search-box').css('height',search_img_height);
				}
			</script>
			<div class="search-layer">
				<input type="text" class="search-input" id="searchname" name="searchname"  onkeydown="if(event.keyCode==13){search_name();}" placeholder="正品美妆 韩国直邮" style="border-radius:3px;">
				<button class="search-button" onclick="search_name();"></button>
			</div>
		</div>

		<div class="shop_skin_index_list banner"  rel="edit-t02" no="1">
			<div class="img"></div>
			<div class="mod" style="display: none;">&nbsp;</div>
		</div>

		<style>

			.fenlei_ad .fenlei_img{float:left;width:33%;overflow:hidden;}
			.fenlei_bottom_ad .fenlei_ad_img{float:left;width:50%;}
			.fenlei_bottom_ad{margin-bottom:5px;}
		</style>
		<div style="width:100%;margin:0 auto;margin-top:10px;overflow:hidden;display:block;" class="fenlei_ad">
			<div class="fenlei_img">
				<div class="shop_skin_index_list"  rel="edit-t31" no="30">
					<div class="img"></div>
				</div>
			</div>
			<div class="fenlei_img">
				<div class="shop_skin_index_list"  rel="edit-t32" no="31">
					<div class="img"></div>
				</div>
			</div>
			<div class="fenlei_img">
				<div class="shop_skin_index_list"  rel="edit-t33" no="32">
					<div class="img"></div>
				</div>
			</div>
		</div>
		<div class="fenlei_bottom_ad">
			<div class="shop_skin_index_list fenlei_ad_img"  rel="edit-t34" no="33">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list fenlei_ad_img"  rel="edit-t35" no="34">
				<div class="img"></div>
			</div>
		</div>


		<script>
			$(document).ready(function(){

			var window_width=$(window).width();
			var banner_width =window_width;
			var left_width=$(window).width()/2.4;
			var top_width=$(window).width()/1.7;
			var top_height=$(window).width()/1.7/3;
			//var top_height=top_width/3;
			var bottom_width=$(window).width()/1.7;
			var banner_pren_h=$(window).width()/3.17;
			var product_css=$(window).width()/2;
			var product_css1=$(window).width()/3;
			var product_css2=$(window).width()*0.44;
			var bottom_img_h=$(window).width()/6.24;

			$(".banner img").css("width",banner_width+"px");
			$(".left-img img").css("width",top_width+"px");
			$(".right-top-img img").css("width",top_width+"px");
			$(".right-top-img img").css("height",top_height+"px");

			$(".right-top-img .img").css("height",top_height+"px");

			$(".right-bottom-img img").css("height",top_height+"px");
			$(".right-bottom-img img").css("width",bottom_width+"px");
			$(".banner_pren").css("width",window_width+"px");
			$(".banner_pren").css("height",banner_pren_h+"px");
			$(".product_css").css("width",product_css+"px");
			$(".product_css").css("height",product_css+"px");
			$(".product_css1").css("width",product_css1+"px");
			$(".product_css1").css("height",product_css1+"px");
			$(".bottom_img img").css("width",window_width+"px");
			$(".bottom_img img").css("height",bottom_img_h+"px");
			$(".w50-img").css("width",product_css+"px");
			//$(".w50-img").css("height",product_css+"px");
			//$(".goods_box img").css("width",product_css2+"px");
			//$(".goods_box img").css("height",product_css2+"px");
			});
			$(function(){
					$(window).resize(function(){
					var two_height=$('.right-top-img img').innerHeight()+$('.right-bottom-img img').innerHeight();
					$('.left-img img').height(two_height);
				});
					 $(window).resize();
				})

		</script>

		<div class="img-box">
			<div class="shop_skin_index_list left-img" rel="edit-t19" no="18">
				<div class="img " ></div>
			</div>
			<div class="shop_skin_index_list right-top-img" rel="edit-t20" no="19">
				<div class="img "></div>
			</div>

			<div class="shop_skin_index_list right-bottom-img" rel="edit-t21" no="20">

				<div class="img "></div>
			</div>


			<div class="clear"></div>
		</div>

		<?php

			$cat="select id,name,cat_index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and parent_id <0 ";

			if($sort_str){
			 $cat =$cat.' order by field(id'.$sort_str.')';
			 }
			$result_cat=_mysql_query($cat) or die ("cat_query faild" .mysql_error());
			while($row=mysql_fetch_object($result_cat)){
				$cat_parid=$row->id;
				$cat_parname=$row->name;
				$cat_parimgurl=$row->cat_index_imgurl;
				$cat_adurl=$row->cat_adurl;

				//$cat_parname2 = substr($cat_parname,0,4);
				$cat_parname2 = mb_substr($cat_parname,0,4,'utf-8');
				if($cat_parimgurl){
		?>

		<div class="product-box">
			<div class="title">

				<span style="position:absolute;left:3px;line-height:38px;color:#fff;"><?php echo $cat_parname2;?></span>
				<img src="../common/fengge55/images/title.png" class="title">
			</div>
			<a href="../../mshop/list.php?tid=<?php echo $cat_parid; ?>&tname=<?php echo $cat_parname; ?>&customer_id=<?php echo $customer_id_en; ?>"><span class="more">更多>></span></a>
			<a href="<?php echo $cat_adurl?>"><img src="<?php echo $new_baseurl.$cat_parimgurl;?>" class="banner banner_pren"></a><!--一级分类首页图-->
			<?php  //子分类
				$i=1;
				$cat_son="select id,name,cat_index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and top_id=".$cat_parid." order by id desc limit 0,5";
				$result_cat_son=_mysql_query($cat_son) or die ('cat_son_query faild' .mysql_error());
				while($row=mysql_fetch_object($result_cat_son)){
					$cat_sonid=$row->id;
					$cat_sonname=$row->name;
					$cat_sonimgurl=$row->cat_index_imgurl;
					$cat_sonadurl=$row->cat_adurl;
				if($cat_sonimgurl){
			?>
			<a href="<?php echo $cat_sonadurl?>" ><img src="<?php echo $new_baseurl.$cat_sonimgurl;?>" class="<?php if($i==1){echo 'left-product product_css';}elseif($i==2){echo 'right-product product_css';}elseif($i==3){echo 'three-product border-right product_css1';}elseif($i==4){echo 'three-product border-right product_css1';}elseif($i==5){echo 'three-product product_css1';}?>"></a>

				<?php }?>
				<?php $i++;}?> <!--子分类结束-->
		</div>

			<?php }}?> <!--分类结束-->

		<div style="" >
			<ul id="list">
			<?php
				$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count,introduce from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id."";
					if(!empty($owner_typeids)){
					 //查找自己微店的产品
						 $query = $query." and (";
						 $owner_typeids_arr = explode(",",$owner_typeids);
						 $owner_typeids_count = count($owner_typeids_arr);
						 for($j=0;$j<$owner_typeids_count;$j++){
							 $o_typeid = $owner_typeids_arr[$j];
							 if($j==0){
								$query = $query."(type_id=".$o_typeid." or LOCATE('".$o_typeid."', type_ids)>0)";
							 }else{
								$query = $query." or (type_id=".$o_typeid." or LOCATE('".$o_typeid."', type_ids)>0)";
							 }
						 }
						 $query = $query.")";
					}

					$query= $query." order by asort_value desc,id desc limit 0,20";

					//echo $query;
					$i=1;
					$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
						while ($row = mysql_fetch_object($result)) {
							$pid = $row->id;
							$pname = $row->name;
							$orgin_price = $row->orgin_price;
							$now_price = $row->now_price;
							$p_img = $row->default_imgurl;
							$type_ids =$row->type_ids;
							$pro_discount=$row->pro_discount;
							$sell_count =$row->sell_count;
							$show_sell_count =$row->show_sell_count;
							$introduce= $row->introduce;

							if(empty($p_img)){
								$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
								$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
								$p_img = "";
								while ($row2 = mysql_fetch_object($result2)) {
								$p_img= $row2->imgurl;
								}
							 }

			?>

				<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id; ?>" class="product_box" style="display:block;">
					<div class="goods_box">
						<img src="<?php echo $new_baseurl.$p_img;?>" class="w50-img">
						<p class="good_name"><?php echo $pname;?></p>
						<span class="good_price"> <?php if(OOF_P != 2) echo OOF_S ?><?php echo $now_price;?><?php if(OOF_P == 2) echo OOF_S ?></span><span class="good_sale">已售：<?php echo $sell_count+$show_sell_count;?>笔</span>
					</div>
				</a>

			<?php $i++;}?>
			</ul>
		</div><!--产品列表结束-->

		<?php if($i==21){ ?>
			<script type="text/javascript" src="../common/js/page/fengge55.js"></script>
			<div class="shop_skin_index_list" style="width:100%;margin-bottom: 10px;overflow:hidden">
				<h1 style="background:#ddd;"><button type="button" id="more_commodity" class="div_typename" style="background:#ddd;color:#666;font-size:16px;width:100%;height: 25px;" onclick="get_commodity_detail(<?php echo $customer_id; ?>,<?php echo $owner_typeids?$owner_typeids:"-1"; ?>);">点击加载更多</button></h1>
			</div>
		<?php } ?>

		<div class="shop_skin_index_list" rel="edit-t30" no="29">
			<div class="img bottom_img" ></div>
		</div>

		 <?php


			if($supportname){
		?>
        <style>
			.foot_img img{width:60px;}
		</style>
			<div class="" style="width:100%;display:block;">
            	<section class="members_goodspic" style="margin:10px;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
		<?php }?>

		<div class="footer">
			<div class="footer-box">
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t22" no="21">
						<div class="img"></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t26" no="25">
					   <p><div class="div_typename" ></div></p>
					</div>
				</div>
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t23" no="22">
						<div class="img"></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t27" no="26">
					   <p><div class="div_typename" ></div></p>
					</div>
				</div>
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t24" no="23">
						<div class="img"></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t28" no="27">
					   <p><div class="div_typename" ></div></p>
					</div>
				</div>
				<div class="weidian">
					<div class="shop_skin_index_list" rel="edit-t25" no="24">
						<div class="img"></div>
					</div>
					<div class="shop_skin_index_list" rel="edit-t29" no="28">
					   <p><div class="div_typename" ></div></p>
					</div>
				</div>
			</div>
		</div>

	</div>

</div><!--shop_skin_index end-->


<?php }else if($template_id==56){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>;"<?php } ?> >
<div class="main">
	<div class="shop_skin_index_list w100" rel="edit-t01" no="0">
		<div class="img"></div>
	</div>
	<div class="t-box">
		<div class="shop_skin_index_list t-box-img" rel="edit-t02" no="1">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list t-box-img" rel="edit-t03" no="2">
			<div class="img"></div>
		</div>
	</div>
	<div class="search-layer">
		<input type="text" class="search-input" id="searchname" value="" placeholder="搜索你想要的商品" style="border:none!important;color:#000;">
		<button type="submit" class="search-icon" onclick="search_name()"></button>
	</div>
	<div class="shop_skin_index_list w100" rel="edit-t04" no="3">
		<div class="img"></div>
	</div>
	<div class="shop_skin_index_list w100" rel="edit-t05" no="4">
		<div class="img"></div>
	</div>
	<div class="f-box">
		<div class="shop_skin_index_list f-box-img" rel="edit-t06" no="5">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list f-box-img" rel="edit-t07" no="6">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list f-box-img" rel="edit-t08" no="7">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list f-box-img" rel="edit-t09" no="8">
			<div class="img"></div>
		</div>
	</div>
	<div class="shop_skin_index_list w100" rel="edit-t10" no="9">
		<div class="img"></div>
	</div>
	<div class="k-box">
		<div class="shop_skin_index_list k-box-img" rel="edit-t11" no="10">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list k-box-img" rel="edit-t12" no="11">
			<div class="img"></div>
		</div>

	</div>
	<div class="shop_skin_index_list scroll banner" rel="edit-t13" no="12" style="height:160px;">
		<div class="img"></div>
	</div>

	<section class="custom-line-wrap"><hr class="custom-line"></section>
	<?php
		$cat="select id,index_imgurl,cat_adurl from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and parent_id <0 ";
		if(!empty($owner_typeids)){
			$cat = $cat." and id in (".$owner_typeids.")";
		}
		if($sort_str){
			$cat =$cat.' order by field(id'.$sort_str.')';
		}
		$result_cat=_mysql_query($cat) or die ("cat_query faild" .mysql_error());
		$typeson_id=array();
		while($row=mysql_fetch_object($result_cat)){
			$tid=$row->id;
			$index_imgurl=$row->index_imgurl;
			$cat_adurl=$row->cat_adurl;

			$type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$tid." and customer_id=".$customer_id."";
			$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
			while($row=mysql_fetch_object($result_typeson)){
				$typeson_id[]=$row->id;
			}

	?>
	<div class="floor">
		<a href="<?php echo $cat_adurl;?>"><img src="<?php echo $new_baseurl.$index_imgurl;?>" class="img-floor"></a>

		<?php
			array_push($typeson_id,$tid);
			$typeson_id=implode(',',$typeson_id);
			$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id."";

			if(empty($typeson_id)){
			$typeson_id=$tid;
		}
			$query = $query." and (";
			$typeson_id_arr = explode(",",$typeson_id);
			$typeson_id_count = count($typeson_id_arr);
			for($j=0;$j<$typeson_id_count;$j++){
				$o_typeid = $typeson_id_arr[$j];
				if($j==0){
					$query = $query."( LOCATE(',".$o_typeid.",', type_ids)>0)";
					}else{
					$query = $query." or (LOCATE(',".$o_typeid.",', type_ids)>0)";
				}
			}
			$query = $query.")";

			$query= $query." order by asort_value desc,id desc limit 0,4";

			//	echo $query;
			$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
				while ($row = mysql_fetch_object($result)) {
					$pid = $row->id;
					$pname = $row->name;
					$orgin_price = $row->orgin_price;
					$now_price = $row->now_price;
					$p_img = $row->default_imgurl;
					$type_ids =$row->type_ids;
					$pro_discount=$row->pro_discount;
					$sell_count =$row->sell_count;
					$show_sell_count =$row->show_sell_count;

					if(empty($p_img)){
						$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
						$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
						$p_img = "";
						while ($row2 = mysql_fetch_object($result2)) {
						$p_img= $row2->imgurl;
						}
					 }
		?>
		<div class="pro-box">
			<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><img src="<?php echo $new_baseurl.$p_img;?>"></a>
			<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>"><p class="goods-title "><?php echo $pname;?></p></a>
			<span class="goods-pirce">

			<span class="yen"><?php if(OOF_P != 2) echo OOF_S ?></span>
			<?php echo $now_price;?>
			<span class="yen"><?php if(OOF_P != 2) echo OOF_S ?></span>


			</span>
			<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>" class="addcart"><i></i></a>
		</div>
		<?php } unset($typeson_id);?>
		<div class="clear"></div>
	</div>
	<?php }?>

	<?php
		if($supportname){
	?>
        <style>
			.foot_img img{width:60px;}
		</style>
			<div class="" style="width:100%;display:block;">
            	<section class="members_goodspic" style="margin:10px;">
                    <?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
                    <div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
				</section>
			</div>
	<?php }?>

	<div class="footer">
		<div class="footer-box">
			<div class="weidian">
				<div class="shop_skin_index_list" rel="edit-t14" no="13">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t18" no="17">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="weidian">
				<div class="shop_skin_index_list" rel="edit-t15" no="14">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t19" no="18">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="weidian">
				<div class="shop_skin_index_list" rel="edit-t16" no="15">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t20" no="19">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="weidian">
				<div class="shop_skin_index_list" rel="edit-t17" no="16">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t21" no="20">
				   <p><div class="div_typename" ></div></p>
				</div>
			</div>
		</div>
	</div>
</div>
</div>

<?php }else if($template_id==57){?>
<div id="shop_skin_index" <?php if(!empty($index_bg)){ ?>style="background:#<?php echo $index_bg; ?>;"<?php } ?> >
<div class="main">
	<div class="search-box">
		<div class="shop_skin_index_list" rel="edit-t01" no="0">
			<div class="img"></div>
		</div>
		<div class="search-layer">
			<input type="text" class="search-input" id="searchname" name="searchname" onkeydown="if(event.keyCode==13){search_name();}" placeholder="寻找身边最安全的美食" style="border-radius:10px;">
			<button class="search-button" onclick="javascript:search_name();"></button>
		</div>
	</div>
	<!--<img src="images/scroll.jpg" class="scroll-img">-->
	<div class="shop_skin_index_list scroll-img" rel="edit-t02" no="1">
		<div class="img"></div>
	</div>

	<div class="content-box">

		<div class="icon-box">
			<div class="shop_skin_index_list" rel="edit-t03" no="2">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t11" no="10">
			   <p><div class="div_typename" ></div></p>
			</div>
		</div>
		<div class="icon-box">
			<div class="shop_skin_index_list" rel="edit-t04" no="3">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t12" no="11">
			   <p><div class="div_typename" ></div></p>
			</div>
		</div>
		<div class="icon-box">
			<div class="shop_skin_index_list" rel="edit-t05" no="4">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t13" no="12">
			   <p><div class="div_typename" ></div></p>
			</div>
		</div>
		<div class="icon-box">
			<div class="shop_skin_index_list" rel="edit-t06" no="5">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t14" no="13">
			   <p><div class="div_typename" ></div></p>
			</div>
		</div>
		<div class="icon-box">
			<div class="shop_skin_index_list" rel="edit-t07" no="6">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t15" no="14">
			   <p><div class="div_typename" ></div></p>
			</div>
		</div>
		<div class="icon-box">
			<div class="shop_skin_index_list" rel="edit-t08" no="7">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t16" no="15">
			   <p><div class="div_typename" ></div></p>
			</div>
		</div>
		<div class="icon-box">
			<div class="shop_skin_index_list" rel="edit-t09" no="8">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t17" no="16">
			   <p><div class="div_typename" ></div></p>
			</div>
		</div>
		<div class="icon-box">
			<div class="shop_skin_index_list" rel="edit-t10" no="9">
				<div class="img"></div>
			</div>
			<div class="shop_skin_index_list" rel="edit-t18" no="17">
			   <p><div class="div_typename" ></div></p>
			</div>
		</div>

		<!--<div class="icon-box"><a href="#"><img src="images/icon1.jpg"><p>港式点心</p></a></div>
		<div class="icon-box"><a href="#"><img src="images/icon2.jpg"><p>西点</p></a></div>
		<div class="icon-box"><a href="#"><img src="images/icon3.jpg"><p>冰激凌</p></a></div>
		<div class="icon-box"><a href="#"><img src="images/icon4.jpg"><p>咖啡饮品</p></a></div>
		<div class="icon-box"><a href="#"><img src="images/icon5.jpg"><p>日韩便当</p></a></div>
		<div class="icon-box"><a href="#"><img src="images/icon6.jpg"><p>孩童最爱</p></a></div>
		<div class="icon-box"><a href="#"><img src="images/icon7.jpg"><p>社区超市</p></a></div>
		<div class="icon-box"><a href="#"><img src="images/icon8.jpg"><p>全部</p></a></div>-->
		<div class="clear"></div>
	</div>
	<div class="info">
		<div class="shop_skin_index_list" rel="edit-t19" no="18" style="float:left;">
			<div class="img"></div>
		</div>
		<ul>
			<li>
				<div class="shop_skin_index_list" rel="edit-t30" no="29">
				   <a class="div_typename" ></a>
				</div>
			</li>
			<li>
				<div class="shop_skin_index_list" rel="edit-t31" no="30">
					<a class="div_typename" ></a>
				</div>
			</li>
		</ul>
	</div>
	<div class="w94-box">
		<div class="shop_skin_index_list left-img" rel="edit-t32" no="31">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list right-top-img" rel="edit-t33" no="32">
			<div class="img"></div>
		</div>
		<div class="shop_skin_index_list right-bottom-img" rel="edit-t34" no="33">
			<div class="img"></div>
		</div>

		<!--
		<img src="images/img1.jpg" class="left-img">
		<img src="images/img2.jpg" class="right-top-img">
		<img src="images/img3.jpg" class="right-bottom-img">
		-->
		<div class="clear"></div>
	</div>
	<?php
		$cat="select id,name from weixin_commonshop_types where customer_id=".$customer_id." and is_shelves=true and isvalid=true and parent_id <0 ";
		if(!empty($owner_typeids)){
			$cat = $cat." and id in (".$owner_typeids.")";
		}
		if($sort_str){
			$cat =$cat.' order by field(id'.$sort_str.')';
		}
		$cat=$cat." limit 0,5";
		$result_cat=_mysql_query($cat) or die ("cat_query faild" .mysql_error());
		$typeson_id=array();
		while($row=mysql_fetch_object($result_cat)){
			$cat_parid=$row->id;
			$cat_parname=$row->name;

			$type_son="select id from weixin_commonshop_types where isvalid=true and is_shelves=1 and top_id=".$cat_parid." and customer_id=".$customer_id."";
			$result_typeson=_mysql_query($type_son) or die ('typeson faild ' .mysql_error());
			while($row=mysql_fetch_object($result_typeson)){
				$typeson_id[]=$row->id;
			}
	?>

	<div class="classify-box">
		<a href="../../mshop/list.php?tid=<?php echo $cat_parid; ?>&tname=<?php echo $cat_parname; ?>&customer_id=<?php echo $customer_id_en; ?>">
			<div class="c-title">
				<span class="icon-title"></span><?php echo $cat_parname;?><span class="more">更多>></span>
			</div>
		</a>
		<?php
			array_push($typeson_id,$cat_parid);
			$typeson_id=implode(',',$typeson_id);
			$query = "select id,name,orgin_price,now_price,default_imgurl,type_ids,pro_discount,sell_count,show_sell_count from weixin_commonshop_products where isvalid=true and isout=0 and customer_id=".$customer_id."";

			if(empty($typeson_id)){
				$typeson_id=$cat_parid;
			}
			//echo $typeson_id."====".$cat_parid;
			$query = $query." and (";
			$typeson_id_arr = explode(",",$typeson_id);
			$typeson_id_count = count($typeson_id_arr);
			for($j=0;$j<$typeson_id_count;$j++){
				$o_typeid = $typeson_id_arr[$j];
				if($j==0){
					$query = $query."( LOCATE(',".$o_typeid.",', type_ids)>0)";
					}else{
					$query = $query." or (LOCATE(',".$o_typeid.",', type_ids)>0)";
				}
			}
			$query = $query.")";

			if(!empty($owner_typeids)){
			 //查找自己微店的产品
				 $query = $query." and (";
				 $owner_typeids_arr = explode(",",$owner_typeids);
				 $owner_typeids_count = count($owner_typeids_arr);
				 for($j=0;$j<$owner_typeids_count;$j++){
					 $o_typeid = $owner_typeids_arr[$j];
					 if($j==0){
						$query = $query."(type_id=".$o_typeid." or LOCATE('".$o_typeid."', type_ids)>0)";
					 }else{
						$query = $query." or (type_id=".$o_typeid." or LOCATE('".$o_typeid."', type_ids)>0)";
					 }
				 }
				 $query = $query.")";
			}
			$query= $query." order by asort_value desc,id desc limit 0,2";

			//	echo $query;
			$result = _mysql_query($query) or die('Query failed2: ' . mysql_error());
			while ($row = mysql_fetch_object($result)) {
				$pid = $row->id;
				$pname = $row->name;
				$orgin_price = $row->orgin_price;
				$now_price = $row->now_price;
				$p_img = $row->default_imgurl;
				$type_ids =$row->type_ids;
				$pro_discount=$row->pro_discount;
				$sell_count =$row->sell_count;
				$show_sell_count =$row->show_sell_count;
				if(empty($p_img)){
					$query2 = "select imgurl from weixin_commonshop_product_imgs where isvalid=true and product_id = ".$pid." order by id desc limit 0,1";
					$result2 = _mysql_query($query2) or die('Query failed3: ' . mysql_error());
					$p_img = "";
					while ($row2 = mysql_fetch_object($result2)) {
					$p_img= $row2->imgurl;
					}
				 }
		?>


		<div class="product">
			<a href="../../mshop/product_detail.php?pid=<?php echo $pid; ?>&customer_id=<?php echo $customer_id_en; ?>">
				<img src="<?php echo $new_baseurl.$p_img;?>">
				<span class="price">单价：<?php echo $now_price;?><?php echo OOF_T ?></span>
				<span class="addcart"></span>
			</a>
		</div>
		<?php } unset($typeson_id);?>

		<div class="clear"></div>
	</div>
	<?php }?>
	<?php
		if($supportname){
	?>
        <style>
			.foot_img img{width:60px;}
		</style>
		<div class="" style="width:100%;display:block;margin-top:25px;height:80px;">
			<section class="members_goodspic" style="margin:10px;">
				<?php if($supporttype==3&&$supportImg){?><div align="center" class="foot_img"><img src="<?php echo $supportImg;?>"></div><?php }?>
				<div style="text-align:center;width:100%;"><a href="<?php echo $support_linkurl;?>" style="color:#<?php echo $support_fontcolor;?>;"><?php echo $supportname;?>-提供技术支持</a></div>
			</section>
		</div>
	<?php }?>

	<div class="footer">
		<div class="footer-box">
			<div class="weidian">
				<div class="shop_skin_index_list" rel="edit-t20" no="19">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t25" no="24">
					<p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="weidian">
				<div class="shop_skin_index_list" rel="edit-t21" no="20">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t26" no="25">
					<p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="weidian">
				<div class="shop_skin_index_list" rel="edit-t22" no="21">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t27" no="26">
					<p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="weidian">
				<div class="shop_skin_index_list" rel="edit-t23" no="22">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t28" no="27">
					<p><div class="div_typename" ></div></p>
				</div>
			</div>
			<div class="weidian">
				<div class="shop_skin_index_list" rel="edit-t24" no="23">
					<div class="img"></div>
				</div>
				<div class="shop_skin_index_list" rel="edit-t29" no="28">
					<p><div class="div_typename" ></div></p>
				</div>
			</div>
		</div>
	</div>

</div>
<script type="text/javascript">
	$(function(){
		function func(){
			var two_height=$('.right-top-img').find('img').height()+$('.right-bottom-img').find('img').height()+3;
		$('.left-img').find('img').height(two_height);
		var two_h=$('.p2').find('img').height()
		$('.p1').find('img').height(two_h);
		}
		window.onload=func;
	});
</script>
</div>

<?php } ?>

<?php if($template_id>0 && $template_id!=53) { ?>
 <div id="category">
    <div class="close"></div>
	<dl>
			<?php
			  $query="select id,name from weixin_commonshop_types where isvalid=true and is_shelves=1 and customer_id=".$customer_id." and parent_id=-1";

			   if(!empty($owner_typeids)){
				  $query = $query." and id in (".$owner_typeids.")";
			   }
			   if($sort_str){
				 $query =$query.' order by field(id'.$sort_str.')';
				 }
			 //  $query=$query." order by id desc";

			  $result = _mysql_query($query) or die('Query failed: ' . mysql_error());

              while ($row = mysql_fetch_object($result)) {
			      $tid=$row->id;
				  $tname = $row->name;
			?>
			<dt onclick="document.location='../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>&tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>'"><a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>&tid=<?php echo $tid; ?>&tname=<?php echo $tname; ?>"><?php echo $tname; ?></a></dt>
			<?php
			      $query2="select id,name from weixin_commonshop_types where isvalid=true and is_shelves=1 and customer_id=".$customer_id." and parent_id=".$tid;
				   if(!empty($owner_typeids)){
					  $query2 = $query2." and id in (".$owner_typeids.")";
				   }
		          $query2=$query2." order by id desc";
			      $result2 = _mysql_query($query2) or die('Query failed: ' . mysql_error());

                  while ($row2 = mysql_fetch_object($result2)) {
			         $sub_tid=$row2->id;
				     $sub_tname = $row2->name;
				 ?>
			        <dt  style="background:none" onclick="document.location='../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>&tid=<?php echo $sub_tid; ?>&tname=<?php echo $sub_tname; ?>';"><span style="padding-left:10px;"><a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>&tid=<?php echo $sub_tid; ?>&tname=<?php echo $sub_tname; ?>" style="font-size:12px;"><?php echo $sub_tname; ?></a></span></dt>
		<?php
		          $query3="select id,name from weixin_commonshop_types where isvalid=true and is_shelves=1 and customer_id=".$customer_id." and parent_id=".$sub_tid;
				   if(!empty($owner_typeids)){
					  $query3 = $query3." and id in (".$owner_typeids.")";
				   }
				   $query3=$query3." order by id desc";
				   $query3= $query3." limit 0,9";
			      $result3 = _mysql_query($query3) or die('Query failed: ' . mysql_error());

                  while ($row3 = mysql_fetch_object($result3)) {
			         $sub_sub_tid=$row3->id;
				     $sub_sub_tname = $row3->name;
					 ?>
					 <dt  style="background:none" onclick="document.location='../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>&tid=<?php echo $sub_sub_tid; ?>&tname=<?php echo $sub_sub_tname; ?>';"><span style="padding-left:10px;"><a href="../../mshop/list.php?customer_id=<?php echo $customer_id_en; ?>&tid=<?php echo $sub_sub_tid; ?>&tname=<?php echo $sub_sub_tname; ?>" style="font-size:12px;"><?php echo $sub_sub_tname; ?></a></span></dt>
		<?php    }
		      }
		}
		?>


	</dl>
</div>
<?php } ?>

<!----------------------限时广告图------------------------>
<!-- 判断是否有广告上架，有则查出id和广告类型 -->
<?php
    $ad_up_id = 0;
    $ad_up_query = "select id, show_type,timelimit_type,start_time,end_time from weixin_commonshop_ads where isvalid=1 and status=1 and customer_id=".$customer_id." limit 0,1";
    $ad_up_result = _mysql_query($ad_up_query) or die('ad_up_query Query failed: ' . mysql_error());
    while ($row = mysql_fetch_object($ad_up_result)) {
        $ad_up_id        = $row->id;				//上架广告的id
        $show_type       = $row->show_type;        //广告模式 0：半屏；1：全屏
        $timelimit_type  = $row->timelimit_type;   //广告图显示时间模式 0：永久 1：自定义时间
        $start_time      = $row->start_time;       //开始时间
        $end_time        = $row->end_time;         //结束时间
    }

	//判断广告图的时间是否在播放时间
	if($timelimit_type == 1){
		$nowtime = strtotime(date("Y-m-d H:i:s",time()));
		$starttime = strtotime($start_time);
        $endtime = strtotime($end_time);
		if(($nowtime - $starttime < 0) || ($nowtime - $endtime > 0)){
			$ad_up_id =0;
		}
	}

    if($ad_up_id  && !isset($_SESSION['adver'])){
        $ad_imgs_query = "select * from weixin_commonshop_ad_imgs where isvalid=1  and customer_id=".$customer_id." and ad_id=".$ad_up_id." limit 0,1";
        $ad_imgs_result = _mysql_query($ad_imgs_query) or die('ad_up_query Query failed: ' . mysql_error());
        while ($row = mysql_fetch_object($ad_imgs_result)) {
            $show_time        = $row->show_time;				//
            $imgurl          = $row->imgurl;
            $link            = $row->link;
        }

?>

<div class="limit-content" id="limit-content" style="display:none;">
    <?php
        if($show_type == 0) {
    ?>
        <!-- 半屏 -->
        <div class="limit-half">
            <div class="limit-cloce" onclick="limit_cloce();"><img src="img/view_close.png"></div>
            <a href="<?php echo $link;?>" class="limit-box" style="background-image:url(<?php echo $imgurl;?>);"></a>
        </div>
    <?php
        }else{
			$links 	 = explode("|",$link);
			$imgurls = explode("|",$imgurl);
			//如果只有一张图片，则不轮播
			if(count($imgurls)==1){
				$show_time = '';
				$onlyExternal = true;
			}else{
				$show_time = $show_time*1000;
				$onlyExternal = '';
			}
    ?>

        <!-- 全屏 -->
        <div class="swiper-container limit-full">
            <div class="limit-skip" onclick="limit_cloce();">跳过 ></div>
            <div class="swiper-wrapper">
				<?php for($i=0; $i<count($links); $i++){?>
                <a class="swiper-slide" href="<?php echo $links[$i];?>" style="background-image:url(<?php echo $imgurls[$i];?>);"></a>
				<?php }?>
            </div>
            <div class="swiper-pagination swiper-pagination-banner"></div>
        </div>
    <?php
        }?>
</div>

 <?php
    }

 ?>
<script>
	var ads_value = sessionStorage.getItem("adver");
	var ad_up_id = '<?php if($ad_up_id){echo $ad_up_id;}?>';
	if(ads_value != 1 && ad_up_id){
		$("#limit-content").css("display","block");
	}else{
		$("#limit-content").css("display","none");
	}
</script>
<script type="text/javascript" src='js/swiper.min.js'></script>
<script type="text/javascript">
var user_id 		= '<?php echo $user_id;?>';
var o_shop_id       = -1; 
var limit_width  = $('.limit-box').width();//半屏广告宽度
var user_address="没有地址";        //用户地址
$('.limit-box').height(limit_width*94/63);//半屏广告高度
$('.limit-box').css('margin-top',-limit_width*94/126);//居中
// 关闭限时广告

function limit_cloce(){
	$('.limit-content').remove();
	sessionStorage.setItem("adver", "1");
};

$('#limit-content').click(function(){
	sessionStorage.setItem("adver", "1");
});



if(typeof user_id === "undefined" || user_id <= 0 || user_id == '') {
}else{
	$.getJSON("data_info.php?user_id=<?php echo passport_encrypt((string)$user_id);?>", function(result){
		if(!result.status){
			alert('请先选择您附近的提货点!');
			location.href='tzchoice.php?customer_id=<?php echo $customer_id_en; ?>&user_id=<?php echo passport_encrypt((string)$user_id);?>';
			return;	
		}else{
          
            user_address=result["tinfo"];
            $.cookie('user_address',"<?php echo user_address ?>",{ expires: 1 });  
			//$("#dingweitip").hide();
		}
	});
}

console.log("user_address ="+"<?php echo $user_address ?>" );
//全屏广告轮播
var limit = new Swiper('.limit-full', {
    loop:true,
	onlyExternal:'<?php echo $onlyExternal;?>',
    autoplay: '<?php echo $show_time;?>',//可选选项，自动滑动
    // 如果需要分页器
    pagination: '.swiper-pagination-banner',
});

function initCartData(){
	var pid					= -1;			//产品id
	var p_num				= 0;			//产品数量
	var pos					= "";			//产品属性
	var live_room_id 		= 0;			//商城直播房间id
	var check_first_extend 	= 0;			//是否首次推广奖励
	var act_type 			= -1;			//产品活动类型，1积分兑换产品
	var act_id 				= -1;			//活动id
	var delarr				= new Array();	//要删除的信息数组
	var LS_json             = "";           //购物车数据
	var usercart = '';
	
	if(user_id > 0){
		if(o_shop_id > 0){
			if( !localStorage.getItem("cart_user_"+user_id+"_shop_"+o_shop_id) ){
				localStorage.setItem("cart_user_"+user_id+"_shop_"+o_shop_id,"");
			}
			LS_json = localStorage.getItem("cart_user_"+user_id+"_shop_"+o_shop_id);
		}else{
			if( !localStorage.getItem("cart_"+user_id) ){
				localStorage.setItem("cart_"+user_id,"");
			}
			LS_json = localStorage.getItem("cart_"+user_id);
			console.log(LS_json);
		}
	}else{
		if( !localStorage.getItem("cart_visitor") ){
			localStorage.setItem("cart_visitor","");
		}
		LS_json = localStorage.getItem("cart_visitor");
	}

	if(LS_json != ""){
		LS_json = eval(LS_json);
	}
	console.log(LS_json);
	if( LS_json == "" ){
		return false;
	}
	var allnum=0;

	for( var i = 0; i < LS_json.length; i++){
		var pro = LS_json[i][1];
		/*产品循环开始*/
		for( var j = 0; j < pro.length; j++){
			pid 				= pro[j][0];//产品id
			p_num 				= pro[j][1];//产品数量
			usercart = localStorage.getItem("user_cart_num_"+pid);
			if(usercart){
				p_num=usercart;
			}
			allnum = allnum+p_num;
			if(p_num>0){
				var gli = 'lijigoumaiann_'+pid;
				$('#'+gli).find('.goumaicontainer').find(".anniushuzi").html(p_num);
				$('#'+gli).find('.goumaicontainer').find(".goumaianniu").hide();
				$('#'+gli).find('.goumaicontainer').find(".goumaianniujiajian").show();
			}


		}


	}
	$('#cart_num').html(allnum);

}
$(function() {
initCartData();
});
	function getElementByAttr(tag,attr,value)
	{
	    var aElements = document.getElementById('goods_list').getElementsByTagName(tag);
	    var aEle=[];
	    for(var i=0;i<aElements.length;i++)
	    {
	        if(aElements[i].getAttribute(attr)==value)
	            aEle.push( aElements[i] );
	    }
	    return aEle;
	}

function buyClick(id){

		new	setCartGoodsNumber(id,0,1,'jia');
}
	function subCountClick(id){
		new setCartGoodsNumber(id,0,1,'jian');
	}
	function addCountClick(id){
		new setCartGoodsNumber(id,0,1,'jia');
	}
	

	//修改用户购物车商品数量
function setCartGoodsNumber(goods_id,oid,num,addtype){
		//var gli = getElementByAttr('div','data-id',goods_id);
		var gli = 'lijigoumaiann_'+goods_id;
		
		var mount_count = $('#'+gli).find('.goumaicontainer').find(".anniushuzi").html();
		mount_count = parseInt(mount_count);
		if(addtype=='jia' && mount_count==999){
			return;
		}
		if(addtype=='jian' && mount_count==1){
			return;
		}
		if(addtype == 'jia'){
			mount_count = mount_count + num;
		}else{
			mount_count = mount_count - num;
		}
		set_cart_num(goods_id, mount_count,addtype)
		$('#'+gli).find('.goumaicontainer').find(".anniushuzi").html(mount_count);
		$('#'+gli).find('.goumaicontainer').find(".goumaianniu").hide();
		$('#'+gli).find('.goumaicontainer').find(".goumaianniujiajian").show();

}

function set_cart_num(pid, num,addtype){
	var supply_id 	= $("#is_supply_id_"+pid).val();//供应商ID
	var stock 		= $("#storenum_"+pid).val();//库存
	var is_QR 		= $("#is_QR_"+pid).val();
	var is_identity 		= $("#is_identity"+pid).val();
	var is_virtual 		= $("#is_virtual"+pid).val();
	var pro_card_level_id 		= $("#pro_card_level_id"+pid).val();
	addToCart(is_QR,is_identity,is_virtual,pid,supply_id,pro_card_level_id,addtype)

}

<?php if($ad_up_id !=0){?>
//前端监控广告过期
window.setInterval(function (){

	<?php if($timelimit_type == 1){?>
	//获取服务器时间
	var xmlHttp = new XMLHttpRequest();
	if( !xmlHttp ){
	xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlHttp.open("HEAD",location.href,false);
	xmlHttp.send();
	var severtime=new Date(xmlHttp.getResponseHeader("Date"));
	timestamp = new Date(severtime).getTime();

	var ads_endtime = <?php echo strtotime($end_time); ?>;
	//var timelimit_type = <?php echo $timelimit_type; ?>;
	var checktime = (timestamp/1000) - ads_endtime;
	//如果过期，则关闭广告
	if(checktime>0){
		$(".limit-content").css("display","none");
	}
	<?php }?>

	//如果后台下架，则关闭广告
	var now_ads_status = 1;
	now_ads_status = get_ads_status(<?php echo $ad_up_id; ?>);

	if((now_ads_status == 0) || (now_ads_status == null)){
		if(now_ads_status != undefined){
			$(".limit-content").css("display","none");
		}
	}

}, 1000);
<?php }?>

function get_ads_status(id){
	var result;
	var that = this;
	$.ajax({
		 type: "POST",
		 url: "get_ads_status.php",
		 data: {ads_id:id},
		 dataType: "json",
		 success: function(data){
			that.result = data.status;

		 }
	 });

	return	that.result;
};

</script>


<?php $pid = '';  //小能客服首页不使用?>
<?php if($is_showbottom_menu){
/*判断是否显示底部菜单 start*/
require_once('../../common/utility_setting_function.php');
if($template_id == -1 ){
	$fun = "diy_template";	
}elseif($template_id >0){
	$fun = "index";
}	
$is_publish = check_is_publish(2,$fun,$customer_id);

if($is_publish){
	require_once('../../mshop/bottom_label.php');
}
/*判断是否显示底部菜单 end*/
 }
$nav_is_publish = check_nav_is_publish($fun,$customer_id);
include_once('../../mshop/float.php');
 ?>
<?php include 'share.php';?>


<?php

mysql_close($link);
?>
<script src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
function search_name(){
	var searchname = document.getElementById("searchname").value;
	var url="../../mshop/list.php?searchname="+searchname+""+"&customer_id=<?php echo $customer_id_en; ?>";
	document.location = url;
}
function lbs_search_name(){
	var lbs_searchname = document.getElementById("lbs_searchname").value;
	var url="../../mshop/list.php?searchname="+lbs_searchname+""+"&customer_id=<?php echo $customer_id_en; ?>";
	document.location = url;
}
  /*  var title="<?php echo $shop_name; ?>";
	  var imgurl="<?php echo $new_baseurl.$p_img; ?>";
	  var desc1="<?php echo $shop_name; ?>";
	  var linkurl="<?php echo $linkurl; ?>";
	*/

	var title = '<?php echo '【'.$data_uid_address['address'].'】'.$shop_name?>';
	var link ='<?php echo $linkurl; ?>'; //微信默认分享链接
	var new_share_url = '<?php echo $new_share_url; ?>';	//QQ，QQ空间，QQ微博分享链接
	var imgUrl;

	<?php
		if(!empty($define_share_image)){
	?>
		imgUrl= '<?php echo $new_baseurl.'/'.$define_share_image; ?>';  // 分享图标
	<?php
		}elseif (!empty($p_img)){
	?>
		imgUrl='<?php echo $new_baseurl.$p_img; ?>'; // 分享图标
	<?php
		} else {
    ?>
        imgUrl='<?php echo $new_baseurl.'/weixinpl/pic/uniqlo.png'; ?>'; // 分享图标
    <?php
        }
	?>
	var desc;
	desc = '<?php
			$owner_introduce = str_replace(chr(10),'',$owner_introduce);
			$owner_introduce = str_replace(chr(13),'',$owner_introduce);
			echo $owner_introduce;
			?>';
	if ( desc.length >= 120 ) {
		desc = desc.substring(0, 115)+'...';
	}
	//传值给app
	var app_share_data = {
		appId: '<?php echo $signPackage["appId"];?>',
		timestamp: '<?php echo $signPackage["timestamp"];?>',
		nonceStr: '<?php echo $signPackage["nonceStr"];?>',
		signature: '<?php echo $signPackage["signature"];?>',
		share_url: link,
		title: title,
		desc: desc,
		imgUrl: imgUrl,
		share_type: 1
	};
	var share_app_type = <?php echo $g_app_type;?>;

	function getAppShareData () {
		var _app_share_data = JSON.stringify(app_share_data);
		if ( _app_share_data == '{}' ) {
			_app_share_data = '';
		}

		//android不用返回值
		if ( share_app_type == 1 ) {	//app: ios
			return _app_share_data;
		} else if ( share_app_type == 2 ) {	//android
			window.android.androidGetShareDate(_app_share_data);
		}
	}


   wx.config({
    debug: false,
    appId: '<?php echo $signPackage["appId"];?>',
    timestamp: '<?php echo $signPackage["timestamp"];?>',
    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
    signature: '<?php echo $signPackage["signature"];?>',
    jsApiList: [
      // 所有要调用的 API 都要加到这个列表中
	  'onMenuShareTimeline',
	  'onMenuShareAppMessage',
	  'hideMenuItems',
	  'onMenuShareQQ',
	  'onMenuShareWeibo',
	  'onMenuShareQZone',
    ]
  });

  wx.ready(function () {
    // 在这里调用 API
	/* 	wx.hideMenuItems({
			menuList: [
				"menuItem:share:qq",//隐藏分享到QQ
				'menuItem:copyUrl', // 复制链接
				"menuItem:originPage",//原网页
				"menuItem:readMode",//阅读模式
				"menuItem:openWithQQBrowser",//在QQ浏览器中打开
				"menuItem:openWithSafari", //在Safari中打开
				"getLocation"
			], // 要隐藏的菜单项，所有menu项见附录3
		}); */
		wx.onMenuShareTimeline({
			title: title, // 分享标题
			link: link, // 分享链接
			imgUrl:imgUrl, // 分享图标
			success: function () {
				// 用户确认分享后执行的回调函数
			},
			cancel: function () {
				// 用户取消分享后执行的回调函数
			}
		});

		wx.onMenuShareAppMessage({
			title: title, // 分享标题
			desc: desc, // 分享描述
			link: link, // 分享链接
			imgUrl:imgUrl,
			//imgUrl: '<?php echo $new_baseurl.$p_img; ?>', // 分享图标
			type: '', // 分享类型,music、video或link，不填默认为link
			dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
			success: function () {
				// 用户确认分享后执行的回调函数

			},
			cancel: function () {
				// 用户取消分享后执行的回调函数
			}
		});



		wx.onMenuShareQQ({
				title: title, // 分享标题
				desc: desc, // 分享描述
				link: new_share_url, // 分享链接
				imgUrl: imgUrl, // 分享图标
				success: function () {
				   // 用户确认分享后执行的回调函数
				},
				cancel: function () {
				   // 用户取消分享后执行的回调函数
				}
			});

			wx.onMenuShareWeibo({
				title: title, // 分享标题
				desc: desc, // 分享描述
				link: new_share_url, // 分享链接
				imgUrl: imgUrl, // 分享图标
				success: function () {
				   // 用户确认分享后执行的回调函数
				},
				cancel: function () {
					// 用户取消分享后执行的回调函数
				}
			});

			wx.onMenuShareQZone({
				title: title, // 分享标题
				desc: desc, // 分享描述
				link: new_share_url, // 分享链接
				imgUrl: imgUrl, // 分享图标
				success: function () {
				   // 用户确认分享后执行的回调函数
				},
				cancel: function () {
					// 用户取消分享后执行的回调函数
				}
			});

		<?php if($template_id==46){?>
		wx.getLocation({
			success: function (res) {
				JSON.stringify(res);
				getLocation(1)
			},
			cancel: function (res) {
				alert('用户拒绝授权获取地理位置');
			}
		});

		function golocation(){
			var status = true;
			var urls = 'index.php?customer_id=' + customer_id_en;
			var form_str = '';
			if( typeof(location_info.city)=="undefined" ){
				location_info.city = '';
			}
			form_str += "<form method='get' action='"+urls+"' id='upform' class='hidden'>";
			form_str += "<input type='text' name='city_name' value='"+location_info.city+"'>";
			form_str += "<input type='text' name='status' value='"+status+"'>";
			<?php if($exp_user_id>0){ ?>
			url = url + '&exp_user_id=<?php echo $exp_user_id;?>';
			<?php } ?>
			<?php if($owner_id>0){ ?>
			url = url + '&owner_id=<?php echo $owner_id;?>';
			<?php } ?>
			form_str += "</form>";
			$('body').append(form_str)
			$('#upform').submit();
		}
		<?php }?>

  });
</script>
<!--script type="text/javascript" src="js/jquery.lazyload.js"></script-->
<script>
	$(function() {
		$("#list img").lazyload({effect: "fadeIn"});
	});
	function close_button(){
			document.getElementById("dianji_bg").style.display="none";
		}


</script>

<script type="text/javascript">
  var WHeight = $(window).height();
  $('#category').css('max-height',WHeight+'px');
// 记录滚动高度
// $(function() {
// sctpFun();
// });
// 	function onscrollFun() {
// 		var scrollTH=$(window).scrollTop();
// 		localStorage.scrollTHH=scrollTH;
// 		localStorage.pageNum=page_num;
// 	}
// 	function sctpFun() {
// 		console.log(localStorage.scrollTHH)
// 		var scrollTHHH=localStorage.scrollTHH;
// 		var pageNum=localStorage.pageNum;
// 		if (scrollTHHH) { //如果有记录scrolltop。返回到滚动处
// 			var startTime = new Date().getTime();
// 			var setScroll= setInterval(function(){
// 				$(window).scrollTop(scrollTHHH);
// 				if(new Date().getTime() - startTime > 2000 ||$(window).scrollTop()==scrollTHHH){
// 					clearInterval(setScroll);
// 					return;
// 				}
// 			},100);
// 		}
// 		var customer_id='<?php echo $customer_id?>';
// 		var owner_typeids='<?php echo $owner_typeids?>';
// 		for (var i = 0; i < pageNum; i++) {
// 			get_commodity_detail(customer_id,owner_typeids);
// 		}

// 		localStorage.scrollTHH=""; //返回后清空记录的内容，设置数据回正常。
// 	}

/*深圳添加 用于 艺人*/
function getCookie(name){
    var arr,reg = new RegExp("(^| )"+name+"=([^;]*)(;|$)");
    if(arr=document.cookie.match(reg))
        return unescape(arr[2]);
    else
        return null;
}

<?php
if(is_numeric($user_id)){
	echo "localStorage.setItem('user_id_en','".passport_encrypt((string)$user_id)."');";
	// echo "localStorage.setItem('','".passport_encrypt((string)$user_id)."');";
	// var_dump($_SESSION);
}
?>
/*深圳添加 用于 艺人*/
</script>
<script src="/weixinpl/mshop/js/CheckUserLogin.js"></script><!--检验用户是否已登录-->
</body>
</html>